8.6.8.2.3. pymodaq_gui.utils.widgets.highlighted_combo module

class pymodaq_gui.utils.widgets.highlighted_combo.ComboModel(parent=None)[source]

Bases: QAbstractListModel

Methods

data

rowCount

set_data

set_highlighted_index

data(index, role)[source]
rowCount(parent)[source]
Return type:

int

set_data(data)[source]
set_highlighted_index(index)[source]
staticMetaObject = PySide6.QtCore.QMetaObject("ComboModel" inherits "QAbstractListModel": )
class pymodaq_gui.utils.widgets.highlighted_combo.HighlightedComboBox(parent=None)[source]

Bases: ComboBox

This Combo Box will highlight one of its item depending on the value of the highlighted_index set with the set_highlighted_index method

The highlighted color can be set using the activated_color property (QColor)

This highlighting is using both the Model/View and SetStyleSheet paradigm to allow this behaviour.

Attributes:
activated_color
highlighted_index

Methods

addItems

combo_model

set_highlighted_index

set_style

style_color_from_qcolor

addItems(items)[source]
combo_model()[source]
Return type:

ComboModel

set_highlighted_index(index)[source]
set_style(index=None)[source]
style_color_from_qcolor(color)[source]
Return type:

str

property activated_color
property highlighted_index: int
staticMetaObject = PySide6.QtCore.QMetaObject("HighlightedComboBox" inherits "ComboBox": )