edifice.Dropdown#
- class edifice.Dropdown(selection='', text='', options=None, editable=False, on_change=None, on_select=None, enable_mouse_scroll=True, **kwargs)[source]#
Bases:
QtWidgetElement
Basic widget for a dropdown menu.
Underlying Qt Widget QComboBox
- Parameters:
selection (
str
) – Current selection text of the text input.text (
str
) – Initial text of the text input.options (
Optional
[Sequence
[str
]]) – Options to select from.editable (
bool
) – True if the text input should be editable.on_change (
Optional
[Callable
[[str
],Optional
[Awaitable
[None
]]]]) – Callback for the value of the text input changes. The callback is passed the changed value of the text. This event is only raised wheneditable=True
.on_select (
Optional
[Callable
[[str
],Optional
[Awaitable
[None
]]]]) – Callback for when the selection changes. The callback is passed the new value of the text.enable_mouse_scroll (
bool
) – Whether mouse scroll events should be able to change the value.
Methods
__init__
([selection, text, options, ...])register_ref
(reference)Registers provided
Reference
to this Element.set_key
(key)Sets the key of the 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.