ComboBoxModel#
- texts: List[str],
- values: List[Any] | None = None,
- current_value: Any = None,
Bases:
AbstractItemModel
A data model for items in combobox drop list.
Methods
__init__
(texts[, values, current_value])Constructor.
destroy
()Release resources
get_item_children
(item)Returns all the children when the widget asks it.
get_item_value_model
(item, column_id)Retrieve item value model.
Callback when current selection in combobox changed
- texts: List[str],
- values: List[Any] | None = None,
- current_value: Any = None,
Constructor.
- Parameters:
texts (List[str]) – Texts displayed in combobox
- Keyword Arguments:
values (Optional[List[Any]]) – Values for combobox list, default to None to use text as value
current_value (Any) – Current value displayed in combobox, defaults to None to use first one.
Release resources
- item: ComboBoxItem | None,
Returns all the children when the widget asks it.
- Parameters:
item (Optional[ComboBoxItem]) – Parent itemd, defaults to None means to retrieve root items.
- item: ComboBoxItem | None,
- column_id: int,
Retrieve item value model.
- Parameters:
item (Optional[ComboBoxItem]) – Combobox item.
column_id (int) – Column index.
Callback when current selection in combobox changed