PyDMEnumComboBox¶
-
class
pydm.widgets.enum_combo_box.
PyDMEnumComboBox
(parent=None, init_channel=None)[source]¶ A QComboBox with support for Channels and more from PyDM
- Parameters
parent (QWidget) – The parent widget for the Label
init_channel (str, optional) – The channel to be used by the widget.
Signals –
------- –
send_value_signal (int, float, str, bool or np.ndarray) – Emitted when the user changes the value.
activated (int, str) – Emitted when the user chooses an item in the combobox.
currentIndexChanged (int, str) – Emitted when the index is changed in the combobox.
highlighted (int, str) – Emitted when an item in the combobox popup list is highlighted by the user.
-
addItem
(text, userData=None)[source]¶ Adds an item to the combobox. The item is appended to the list of existing items.
- Parameters
text (str) – Title of the item
userData (QVariant) – Arbitrary user data that is stored in the Qt.UserRole
-
check_enable_state
()[source]¶ Checks whether or not the widget should be disable. This method also disables the widget and add a Tool Tip with the reason why it is disabled.
-
enum_strings_changed
(new_enum_strings)[source]¶ Callback invoked when the Channel has new enum values. This callback also triggers a value_changed call so the new enum values to be broadcasted
- Parameters
new_enum_strings (tuple) – The new list of values
-
internal_combo_box_activated_int
(index)[source]¶ PyQT Slot for when the user chooses an item in the combobox. This slot triggers the
`send_value_signal`
. :param index: :type index: int
-
setItemText
(index, text)[source]¶ Sets the text for the item on the given index in the combobox.
- Parameters
index (int) – Position in the dropdown list
text (str) – Title for the item