SliceListModel#
Superclasses: Object
Implemented Interfaces: ListModel, SectionModel
A list model that presents a slice of another model.
This is useful when implementing paging by setting the size to the number of elements per page and updating the offset whenever a different page is opened.
GtkSliceListModel passes through sections from the underlying model.
Constructors#
- class SliceListModel
Methods#
- class SliceListModel
-
- get_offset() int#
Gets the offset set via
set_offset().
- get_size() int#
Gets the size set via
set_size().
- set_model(model: ListModel | None = None) None#
Sets the model to show a slice of.
The model’s item type must conform to
self's item type.- Parameters:
model – The model to be sliced
Properties#
- class SliceListModel
- props.item_type: GType#
The type of items. See
get_item_type.Added in version 4.8.
- props.n_items: int#
The number of items. See
get_n_items.Added in version 4.8.