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:
QComboBoxA
QComboBoxwith more options in the constructor.- Parameters:
items (
str,listofstr,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 aQIconto 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 (
intorstr, 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.