From e4f750f3391ef974019f826909dab75d97e7da6b Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Fri, 5 Jul 2024 13:54:56 +0200 Subject: [PATCH] return only custom item values --- client/ayon_core/tools/loader/ui/_multicombobox.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/client/ayon_core/tools/loader/ui/_multicombobox.py b/client/ayon_core/tools/loader/ui/_multicombobox.py index 18476fb2ec..66a6963775 100644 --- a/client/ayon_core/tools/loader/ui/_multicombobox.py +++ b/client/ayon_core/tools/loader/ui/_multicombobox.py @@ -282,6 +282,7 @@ class CustomPaintMultiselectComboBox(QtWidgets.QComboBox): self._short_text_role = short_text_role self._text_color_role = text_color_role self._icon_role = icon_role + self._item_type_role = item_type_role self._popup_is_shown = False self._block_mouse_release_timer = QtCore.QTimer(self, singleShot=True) @@ -498,6 +499,10 @@ class CustomPaintMultiselectComboBox(QtWidgets.QComboBox): role = self._value_role items = [] for idx in range(self.count()): + item_type = self.itemData(idx, role=self._item_type_role) + if item_type is not None and item_type != CUSTOM_ITEM_TYPE: + continue + state = checkstate_int_to_enum( self.itemData(idx, role=QtCore.Qt.CheckStateRole) ) @@ -510,6 +515,10 @@ class CustomPaintMultiselectComboBox(QtWidgets.QComboBox): role = self._value_role items = [] for idx in range(self.count()): + item_type = self.itemData(idx, role=self._item_type_role) + if item_type is not None and item_type != CUSTOM_ITEM_TYPE: + continue + state = checkstate_int_to_enum( self.itemData(idx, role=QtCore.Qt.CheckStateRole) )