edifice.Dropdown#
- class edifice.Dropdown(selection=0, options=[], on_select=None, enable_mouse_scroll=True, **kwargs)[source]#
Bases:
QtWidgetElement[QComboBox]Dropdown selection widget.
Underlying Qt Widget QComboBox
Props
All props from
QtWidgetElement, plus:- Parameters:
selection (
int) – Current selection index.options (
Sequence[str]) – Options to select from.on_select (
Optional[Callable[[int],None]]) – Callback for when the selected index changes. The callback is passed the new selected index. This callback is called when the user changes the selection, but not when the selection prop changes.enable_mouse_scroll (
bool) – Whether mouse scroll events should be able to change the selection.
Usage
Dropdown on the right.#
dropselect, dropselect_set = use_state(0) Dropdown( selection=dropselect, options=["Option 1", "Option 2", "Option 3"], on_select=dropselect_set, )
Methods
__init__([selection, options, on_select, ...])register_ref(reference)Registers provided
Referenceto this Element.set_key(key)Set the key of an
Element.Attributes
childrenThe children of this Element.
propsThe props of this Element.
underlyingThe underlying QWidget, which may not exist if this Element has not rendered.