msl.qt.widgets.combobox module¶
A QComboBox
with more options in the constructor.
- class msl.qt.widgets.combobox.ComboBox(*, items=None, initial=None, index_changed=None, text_changed=None, tooltip=None, parent=None)[source]¶
Bases:
QComboBox
A
QComboBox
with more options in the constructor.- Parameters:
items (
str
,list
ofstr
,dict
, optional) – The item(s) to add to the combobox. If astr
, then adds the single item. If alist
, then adds all items. If adict
, then the keys are the text of each item and the values can either be aQIcon
to use as the icon or any other type to use as the userData parameter. To specify both an icon and userData for an item the values can be of typetuple
, e.g., (icon, userData).initial (
int
orstr
, optional) – The index or text of the item to initially display. This value is set before the slots are registered.index_changed – A callable function to use as a slot for the
currentIndexChanged()
signal.text_changed – A callable function to use as a slot for the
currentTextChanged()
signal.tooltip (
str
, optional) – The tooltip to display for the combobox.parent (
QtWidgets.QWidget
, optional) – The parent widget.