[core] Graph: Add a selectedViewpoint property

The `selectedViewpoint` property will store the attribute corresponding to
the actively selected viewpoint, if it exists. Otherwise, it will be set
to None.
This commit is contained in:
Candice Bentéjac 2024-06-18 18:21:07 +02:00
parent 154babbf5c
commit d585b053a5

View file

@ -226,6 +226,8 @@ class Graph(BaseObject):
self._fileDateVersion = 0
self.header = {}
self._selectedViewpoint = None
def clear(self):
self.header.clear()
self._compatibilityNodes.clear()
@ -1564,6 +1566,12 @@ class Graph(BaseObject):
self.updateStatusFromCache(force=True)
self.cacheDirChanged.emit()
@property
def selectedViewpoint(self):
""" Return the attribute describing the viewpoint that is
currently set as the 'selected viewpoint'. """
return self._selectedViewpoint
@property
def fileDateVersion(self):
return self._fileDateVersion