Skip to content

ListModel[T]

ListModel is a Model that stores its data in a Python list.

Construct a ListMode from an iterable (such as a list itself). Use append to add items to the model, and use the del statement to remove items.

Any changes to the model are automatically reflected in the views in UI they’re used with.

Bases: Model[T]

list: list[T]
row_count() -> int
row_data(row: int) -> Optional[T]
set_row_data(row: int, value: T) -> None
append(value: T) -> None

Appends the value to the end of the list.

insert(index: int, value: T) -> None

Inserts the value at the given index. Negative indices and indices past the end of the list behave like list.insert.

notify_row_changed(row: int) -> None

Call this method from a sub-class to notify the views that a row has changed.

notify_row_removed(row: int, count: int) -> None

Call this method from a sub-class to notify the views that count rows have been removed starting at row.

notify_row_added(row: int, count: int) -> None

Call this method from a sub-class to notify the views that count rows have been added starting at row.


© 2026 SixtyFPS GmbH