mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-02 08:54:53 +01:00
use filter combobox for type editor
This commit is contained in:
parent
d76fae0096
commit
342fd59eb2
1 changed files with 8 additions and 1 deletions
|
|
@ -1,5 +1,6 @@
|
|||
from Qt import QtWidgets, QtCore
|
||||
|
||||
from .widgets import FilterComboBox
|
||||
from .multiselection_combobox import MultiSelectionComboBox
|
||||
|
||||
|
||||
|
|
@ -50,7 +51,7 @@ class TypeDelegate(QtWidgets.QStyledItemDelegate):
|
|||
super(TypeDelegate, self).__init__(*args, **kwargs)
|
||||
|
||||
def createEditor(self, parent, option, index):
|
||||
editor = QtWidgets.QComboBox(parent)
|
||||
editor = FilterComboBox(parent)
|
||||
if not self._project_doc_cache.project_doc:
|
||||
return editor
|
||||
|
||||
|
|
@ -59,6 +60,12 @@ class TypeDelegate(QtWidgets.QStyledItemDelegate):
|
|||
|
||||
return editor
|
||||
|
||||
def setEditorData(self, editor, index):
|
||||
value = index.data(QtCore.Qt.EditRole)
|
||||
index = editor.findText(value)
|
||||
if index >= 0:
|
||||
editor.setCurrentIndex(index)
|
||||
|
||||
|
||||
class ToolsDelegate(QtWidgets.QStyledItemDelegate):
|
||||
def __init__(self, tools_cache, *args, **kwargs):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue