mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-02 08:54:53 +01:00
HierarchicalModel has project_item property
This commit is contained in:
parent
2e5bec225a
commit
2a4b4ebdd2
1 changed files with 10 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue