mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
implemented 'get_index_by_project_name'
This commit is contained in:
parent
29cc3d97e5
commit
8ca15394a3
1 changed files with 16 additions and 0 deletions
|
|
@ -47,6 +47,22 @@ class ProjectsQtModel(QtGui.QStandardItemModel):
|
|||
def has_content(self):
|
||||
return len(self._project_items) > 0
|
||||
|
||||
def get_index_by_project_name(self, project_name):
|
||||
"""Get index of project by name.
|
||||
|
||||
Args:
|
||||
project_name (str): Project name.
|
||||
|
||||
Returns:
|
||||
QtCore.QModelIndex: Index of project item. Index is not valid
|
||||
if project is not found.
|
||||
|
||||
"""
|
||||
item = self._project_items.get(project_name)
|
||||
if item is None:
|
||||
return QtCore.QModelIndex()
|
||||
return self.indexFromItem(item)
|
||||
|
||||
def set_select_item_visible(self, visible):
|
||||
if self._select_item_visible is visible:
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue