HierarchicalModel has project_item property

This commit is contained in:
iLLiCiTiT 2021-05-13 16:26:21 +02:00
parent 2e5bec225a
commit 2a4b4ebdd2

View file

@ -138,6 +138,16 @@ class HierarchyModel(QtCore.QAbstractItemModel):
self._current_project = None
self.set_project(project_name)
@property
def project_item(self):
output = None
for row in range(self._root_item.rowCount()):
item = self._root_item.child(row)
if isinstance(item, ProjectItem):
output = item
break
return output
def set_project(self, project_name):
if self._current_project == project_name:
return