schrodinger.application.models.gui.experimental_px.delegates.dict module¶
- class schrodinger.application.models.gui.experimental_px.delegates.dict.DictDelegate(*args, **kwargs)¶
Bases:
DelegateBaseDelegate that paints a Select, allowing users to pick a single item from a popup list.
This delegate works similarly to a QComboBox, which which essentially stores a mapping of item text to userData. The model must provide:
Qt.EditRole: The current userData.DICT_ITEMS_ROLE: aMapping[str, Any]of{text: userData}choices. To preserve ordering for display in the popup list,collections.OrderedDictshould be used.
- DICT_ITEMS_ROLE = 366¶
- __init__(*args, **kwargs)¶
- getButtonState(index: QModelIndex, key: Hashable) State¶
Return the visual state of a button for PanelX rendering APIs.
- Parameters:
index – The cell containing the button
key – Identifier for the button
- Returns:
State.Pressed, State.Hovered, State.Disabled, or State.Default