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
],Optional
[Awaitable
[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
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
Reference
to this Element.set_key
(key)Set the key of an
Element
.Attributes
children
The children of this Element.
props
The props of this Element.
underlying
The underlying QWidget, which may not exist if this Element has not rendered.