gtk.sort_list_model

Module for [SortListModel] class

Types 3

A gio.list_model.ListModel that sorts the elements of an underlying model according to a gtk.sorter.Sorter.

The model is a stable sort. If two items compare equal according to the sorter, the one that appears first in the original model will also appear first after sorting. Note that if you change the sorter, the previous order will have no influence on the new order. If you want that, consider using a gtk.multi_sorter.MultiSorter and appending the previous sorter to it.

The model can be set up to do incremental sorting, so that sorting long lists doesn't block the UI. See gtk.sort_list_model.SortListModel.setIncremental for details.

gtk.sort_list_model.SortListModel is a generic model and because of that it cannot take advantage of any external knowledge when sorting. If you run into performance issues with gtk.sort_list_model.SortListModel, it is strongly recommended that you write your own sorting list model.

gtk.sort_list_model.SortListModel allows sorting the items into sections. It implements gtk.section_model.SectionModel and when gtk.sort_list_model.SortListModel.sectionSorter is set, it will sort all items with that sorter and items comparing equal with it will be put into the same section. The gtk.sort_list_model.SortListModel.sorter will then be used to sort items inside their sections.

Methods
GType _getGType() static nothrow
GType _gType() @property nothrow
SortListModel self() nothrowReturns `this`, for use in `with` statements.
SortListModelGidBuilder builder() static nothrowGet builder for [gtk.sort_list_model.SortListModel] Returns: New builder object
bool incremental() @property nothrowGet `incremental` property. Returns: If the model should sort items incrementally.
void incremental(bool propval) @property nothrowSet `incremental` property. Params: propval = If the model should sort items incrementally.
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: The model being sorted.
void model(gio.list_model.ListModel propval) @property nothrowSet `model` property. Params: propval = The model being sorted.
uint nItems() @property nothrowGet `nItems` property. Returns: The number of items. See [gio.list_model.ListModel.getNItems].
uint pending() @property nothrowGet `pending` property. Returns: Estimate of unsorted items remaining.
gtk.sorter.Sorter sectionSorter() @property nothrowGet `sectionSorter` property. Returns: The section sorter for this model, if one is set.
void sectionSorter(gtk.sorter.Sorter propval) @property nothrowSet `sectionSorter` property. Params: propval = The section sorter for this model, if one is set.
gtk.sorter.Sorter sorter() @property nothrowGet `sorter` property. Returns: The sorter for this model.
void sorter(gtk.sorter.Sorter propval) @property nothrowSet `sorter` property. Params: propval = The sorter for this model.
bool getIncremental() nothrowReturns whether incremental sorting is enabled.
gio.list_model.ListModel getModel() nothrowGets the model currently sorted or null if none. Returns: The model that gets sorted
uint getPending() nothrowEstimates progress of an ongoing sorting operation.
gtk.sorter.Sorter getSectionSorter() nothrowGets the section sorter that is used to sort items of self into sections. Returns: the sorter of #self
gtk.sorter.Sorter getSorter() nothrowGets the sorter that is used to sort self. Returns: the sorter of #self
void setIncremental(bool incremental) nothrowSets the sort model to do an incremental sort.
void setModel(gio.list_model.ListModel model = null) nothrowSets the model to be sorted.
void setSectionSorter(gtk.sorter.Sorter sorter = null) nothrowSets a new section sorter on self.
void setSorter(gtk.sorter.Sorter sorter = null) nothrowSets a new sorter on self.
Constructors
this(void * ptr, Flag!"Take" take)
this(gio.list_model.ListModel model = null, gtk.sorter.Sorter sorter = null)Creates a new sort list model that uses the sorter to sort model.

Fluent builder implementation template for gtk.sort_list_model.SortListModel

Methods
T incremental(bool propval) nothrowSet `incremental` property. Params: propval = If the model should sort items incrementally. Returns: Builder instance for fluent chaining
T model(gio.list_model.ListModel propval) nothrowSet `model` property. Params: propval = The model being sorted. Returns: Builder instance for fluent chaining
T sectionSorter(gtk.sorter.Sorter propval) nothrowSet `sectionSorter` property. Params: propval = The section sorter for this model, if one is set. Returns: Builder instance for fluent chaining
T sorter(gtk.sorter.Sorter propval) nothrowSet `sorter` property. Params: propval = The sorter for this model. Returns: Builder instance for fluent chaining
Methods
SortListModel build() nothrowCreate object from builder. Returns: New object