mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-26 13:52:15 +01:00
add styled delegates to comboboxes
This commit is contained in:
parent
c9228d74a0
commit
5e2e818db2
2 changed files with 8 additions and 0 deletions
|
|
@ -456,6 +456,8 @@ class _SiteCombobox(QtWidgets.QWidget):
|
|||
self
|
||||
)
|
||||
combobox_input = QtWidgets.QComboBox(self)
|
||||
combobox_delegate = QtWidgets.QStyledItemDelegate()
|
||||
combobox_input.setItemDelegate(combobox_delegate)
|
||||
|
||||
main_layout = QtWidgets.QHBoxLayout(self)
|
||||
main_layout.addWidget(label_widget)
|
||||
|
|
@ -464,6 +466,7 @@ class _SiteCombobox(QtWidgets.QWidget):
|
|||
combobox_input.currentIndexChanged.connect(self._on_index_change)
|
||||
self.label_widget = label_widget
|
||||
self.combobox_input = combobox_input
|
||||
self._combobox_delegate = combobox_delegate
|
||||
|
||||
def _set_current_text(self, text):
|
||||
index = None
|
||||
|
|
|
|||
|
|
@ -132,9 +132,14 @@ class SettingsComboBox(QtWidgets.QComboBox):
|
|||
def __init__(self, *args, **kwargs):
|
||||
super(SettingsComboBox, self).__init__(*args, **kwargs)
|
||||
|
||||
delegate = QtWidgets.QStyledItemDelegate()
|
||||
self.setItemDelegate(delegate)
|
||||
|
||||
self.currentIndexChanged.connect(self._on_change)
|
||||
self.setFocusPolicy(QtCore.Qt.StrongFocus)
|
||||
|
||||
self._delegate = delegate
|
||||
|
||||
def wheelEvent(self, event):
|
||||
if self.hasFocus():
|
||||
return super(SettingsComboBox, self).wheelEvent(event)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue