Skip to content

Model[T]

Model is the base class for feeding dynamic data into Slint views.

Subclass Model to implement your own models, or use ListModel to wrap a list.

Models are iterable and can be used in for loops.

Bases: Iterable[T]

set_row_data(row: int, value: T) -> None

Call this method on mutable models to change the data for the given row. The UI will also call this method when modifying a model’s data. Re-implement this method in a sub-class to handle the change.

row_data(row: int) -> Optional[T]

Returns the data for the given row. Re-implement this method in a sub-class to provide the data.

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.

row_count() -> int

© 2026 SixtyFPS GmbH