RadioModel#
Bases:
AbstractItemModelA class that represents a model for radio buttons, allowing the selection of a single option from a list.
- Parameters:
texts (List[str]) – A list of strings representing the options.
default_index (int) – The index of the initially selected option.
Methods
__init__(texts[, default_index])Initializes a new instance of RadioModel.
get_item_children([item])Gets the children items of a given item or all items if no item is provided.
reset()Resets the index to the default value.
Attributes
Gets whether the current selected index is not the default one.
Gets the current index value.
Gets the model of the current index.
Gets the text of the currently selected string.
Initializes a new instance of RadioModel.
- item: RadioItem | None = None,
Gets the children items of a given item or all items if no item is provided.
- Parameters:
item (Optional[RadioItem]) – The parent item or None for all items.
- Returns:
A list of child items.
- Return type:
List[RadioItem]
Resets the index to the default value.
Gets whether the current selected index is not the default one.
- Returns:
True if the current index is not the default, False otherwise.
- Return type:
bool
Gets the current index value.
- Returns:
The current index value.
- Return type:
int
Gets the model of the current index.
- Returns:
The model representing the current index.
- Return type:
ui.SimpleIntModel
Gets the text of the currently selected string.
- Returns:
The text of the current selection.
- Return type:
str