ReverseModel[T]
from slint import ReverseModelReverseModel is a Model that provides the rows of a source model in
reverse order.
The ReverseModel follows the changes of the source model. Setting a row sets the corresponding row of the source model.
numbers = slint.ListModel([1, 2, 3])reversed_numbers = slint.ReverseModel(numbers)assert list(reversed_numbers) == [3, 2, 1]Bases: _WritableAdapterModel[T]
Properties
Section titled “Properties”source_model
Section titled “source_model”source_modelMethods
Section titled “Methods”notify_row_changed
Section titled “notify_row_changed”Call this method from a sub-class to notify the views that a row has changed.
notify_row_removed
Section titled “notify_row_removed”Call this method from a sub-class to notify the views that
count rows have been removed starting at row.
notify_row_added
Section titled “notify_row_added”Call this method from a sub-class to notify the views that
count rows have been added starting at row.
set_row_data
Section titled “set_row_data”Sets the row of the source model that corresponds to row.
Raises IndexError if row is out of range.
row_count
Section titled “row_count”row_count() -> introw_data
Section titled “row_data”row_data(row: int) -> T | Nonepush_row
Section titled “push_row”push_row(value: T) -> NoneAdd a new row to the model with the provided value.
The default implementation calls insert_row with the row count.
remove_row
Section titled “remove_row”Remove the row at the given index.
Raises an exception when the model rejects the modification.
The default implementation raises NotImplementedError. A model that
supports removing rows should also call notify_row_removed.
insert_row
Section titled “insert_row”Insert a new row at the given index.
Raises an exception when the model rejects the modification.
The default implementation raises NotImplementedError. A model that
supports inserting rows should also call notify_row_added.
© 2026 SixtyFPS GmbH