mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-02 08:54:53 +01:00
small changes
This commit is contained in:
parent
2ce685d3e3
commit
cc0cbbfade
3 changed files with 21 additions and 3 deletions
|
|
@ -78,6 +78,8 @@ class NumberDelegate(QtWidgets.QStyledItemDelegate):
|
|||
editor = QtWidgets.QDoubleSpinBox(parent)
|
||||
else:
|
||||
editor = QtWidgets.QSpinBox(parent)
|
||||
|
||||
editor.setObjectName("NumberEditor")
|
||||
editor.setMinimum(self.minimum)
|
||||
editor.setMaximum(self.maximum)
|
||||
|
||||
|
|
@ -97,6 +99,7 @@ class NumberDelegate(QtWidgets.QStyledItemDelegate):
|
|||
class NameDelegate(QtWidgets.QStyledItemDelegate):
|
||||
def createEditor(self, parent, option, index):
|
||||
editor = NameTextEdit(parent)
|
||||
editor.setObjectName("NameEditor")
|
||||
value = index.data(QtCore.Qt.EditRole)
|
||||
if value is not None:
|
||||
editor.setText(str(value))
|
||||
|
|
@ -110,6 +113,7 @@ class TypeDelegate(QtWidgets.QStyledItemDelegate):
|
|||
|
||||
def createEditor(self, parent, option, index):
|
||||
editor = FilterComboBox(parent)
|
||||
editor.setObjectName("TypeEditor")
|
||||
if not self._project_doc_cache.project_doc:
|
||||
return editor
|
||||
|
||||
|
|
@ -132,6 +136,7 @@ class ToolsDelegate(QtWidgets.QStyledItemDelegate):
|
|||
|
||||
def createEditor(self, parent, option, index):
|
||||
editor = MultiSelectionComboBox(parent)
|
||||
editor.setObjectName("ToolEditor")
|
||||
if not self._tools_cache.tools_data:
|
||||
return editor
|
||||
|
||||
|
|
|
|||
|
|
@ -1487,9 +1487,6 @@ class ProjectItem(BaseItem):
|
|||
return QtCore.Qt.ItemIsEnabled | QtCore.Qt.ItemIsSelectable
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
class AssetItem(BaseItem):
|
||||
item_type = "asset"
|
||||
|
||||
|
|
|
|||
|
|
@ -389,9 +389,16 @@ class HierarchyView(QtWidgets.QTreeView):
|
|||
self.edit(index)
|
||||
|
||||
def _remove_delete_flag(self, item_ids):
|
||||
"""Remove deletion flag on items marked for deletion."""
|
||||
self._source_model.remove_delete_flag(item_ids)
|
||||
|
||||
def _expand_items(self, indexes):
|
||||
"""Expand multiple items with all it's children.
|
||||
|
||||
Args:
|
||||
indexes (list): List of QModelIndex that should be expanded.
|
||||
"""
|
||||
|
||||
item_ids = set()
|
||||
process_queue = Queue()
|
||||
for index in indexes:
|
||||
|
|
@ -415,6 +422,11 @@ class HierarchyView(QtWidgets.QTreeView):
|
|||
))
|
||||
|
||||
def _collapse_items(self, indexes):
|
||||
"""Collapse multiple items with all it's children.
|
||||
|
||||
Args:
|
||||
indexes (list): List of QModelIndex that should be collapsed.
|
||||
"""
|
||||
item_ids = set()
|
||||
process_queue = Queue()
|
||||
for index in indexes:
|
||||
|
|
@ -442,6 +454,10 @@ class HierarchyView(QtWidgets.QTreeView):
|
|||
self._parent.show_message(message)
|
||||
|
||||
def _on_context_menu(self, point):
|
||||
"""Context menu on right click.
|
||||
|
||||
Currently is menu shown only on "name" column.
|
||||
"""
|
||||
index = self.indexAt(point)
|
||||
column = index.column()
|
||||
if column != 0:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue