gtk.slice_list_model

Module for [SliceListModel] class

Types 3

gtk.slice_list_model.SliceListModel is 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.

gtk.slice_list_model.SliceListModel passes through sections from the underlying model.

Methods
GType _getGType() static nothrow
GType _gType() @property nothrow
SliceListModel self() nothrowReturns `this`, for use in `with` statements.
SliceListModelGidBuilder builder() static nothrowGet builder for [gtk.slice_list_model.SliceListModel] Returns: New builder object
gobject.types.GType itemType() @property nothrowGet `itemType` property. Returns: The type of items. See [gio.list_model.ListModel.getItemType].
gio.list_model.ListModel model() @property nothrowGet `model` property. Returns: Child model to take slice from.
void model(gio.list_model.ListModel propval) @property nothrowSet `model` property. Params: propval = Child model to take slice from.
uint nItems() @property nothrowGet `nItems` property. Returns: The number of items. See [gio.list_model.ListModel.getNItems].
uint offset() @property nothrowGet `offset` property. Returns: Offset of slice.
void offset(uint propval) @property nothrowSet `offset` property. Params: propval = Offset of slice.
uint size() @property nothrowGet `size` property. Returns: Maximum size of slice.
void size(uint propval) @property nothrowSet `size` property. Params: propval = Maximum size of slice.
gio.list_model.ListModel getModel() nothrowGets the model that is currently being used or null if none. Returns: The model in use
uint getOffset() nothrowGets the offset set via [gtk.slice_list_model.SliceListModel.setOffset]. Returns: The offset
uint getSize() nothrowGets the size set via [gtk.slice_list_model.SliceListModel.setSize]. Returns: The size
void setModel(gio.list_model.ListModel model = null) nothrowSets the model to show a slice of.
void setOffset(uint offset) nothrowSets the offset into the original model for this slice.
void setSize(uint size) nothrowSets the maximum size. self will never have more items than size.
Constructors
this(void * ptr, Flag!"Take" take)
this(gio.list_model.ListModel model, uint offset, uint size)Creates a new slice model.

Fluent builder implementation template for gtk.slice_list_model.SliceListModel

Methods
T model(gio.list_model.ListModel propval) nothrowSet `model` property. Params: propval = Child model to take slice from. Returns: Builder instance for fluent chaining
T offset(uint propval) nothrowSet `offset` property. Params: propval = Offset of slice. Returns: Builder instance for fluent chaining
T size(uint propval) nothrowSet `size` property. Params: propval = Maximum size of slice. Returns: Builder instance for fluent chaining
Methods
SliceListModel build() nothrowCreate object from builder. Returns: New object