PyDMEnumComboBox

class pydm.widgets.enum_combo_box.PyDMEnumComboBox(parent=None, init_channel=None)[source]

Bases: QComboBox, PyDMWritableWidget

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

set_items(enums)[source]

Internal method to fill the ComboBox items based on a list of strings.

Parameters:

enums (tuple) – The new list of values

value_changed(new_val)[source]

Callback invoked when the Channel value is changed. Sets the value of new_value accordingly at the ComboBox.

Parameters:

new_value (str, int, float, bool or np.ndarray) – The new value from the channel. The type depends on the channel.

wheelEvent(self, e: Optional[QWheelEvent])[source]

Note

See QComboBox Documentation for all inherited properties and methods.