mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 21:32:15 +01:00
modified proxy filter for sorting of creators
This commit is contained in:
parent
b67181c4e0
commit
7e1450e95d
1 changed files with 10 additions and 1 deletions
|
|
@ -91,6 +91,15 @@ class CreatorShortDescWidget(QtWidgets.QWidget):
|
|||
self._description_label.setText(description)
|
||||
|
||||
|
||||
class CreatorsProxyModel(QtCore.QSortFilterProxyModel):
|
||||
def lessThan(self, left, right):
|
||||
l_show_order = left.data(CREATOR_SORT_ROLE)
|
||||
r_show_order = right.data(CREATOR_SORT_ROLE)
|
||||
if l_show_order == r_show_order:
|
||||
return super(CreatorsProxyModel, self).lessThan(left, right)
|
||||
return l_show_order < r_show_order
|
||||
|
||||
|
||||
class CreateWidget(QtWidgets.QWidget):
|
||||
def __init__(self, controller, parent=None):
|
||||
super(CreateWidget, self).__init__(parent)
|
||||
|
|
@ -142,7 +151,7 @@ class CreateWidget(QtWidgets.QWidget):
|
|||
|
||||
creators_view = QtWidgets.QListView(creators_view_widget)
|
||||
creators_model = QtGui.QStandardItemModel()
|
||||
creators_sort_model = QtCore.QSortFilterProxyModel()
|
||||
creators_sort_model = CreatorsProxyModel()
|
||||
creators_sort_model.setSourceModel(creators_model)
|
||||
creators_view.setModel(creators_sort_model)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue