Top | ![]() |
![]() |
![]() |
![]() |
GtkSortListModel * | gtk_sort_list_model_new () |
GtkSortListModel * | gtk_sort_list_model_new_for_type () |
void | gtk_sort_list_model_set_sorter () |
GtkSorter * | gtk_sort_list_model_get_sorter () |
void | gtk_sort_list_model_set_model () |
GListModel * | gtk_sort_list_model_get_model () |
GtkSortListModel is a list model that takes a list model and sorts its elements according to a GtkSorter.
GtkSortListModel 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 GtkSortListModel, it is strongly recommended that you write your own sorting list model.
GtkSortListModel * gtk_sort_list_model_new (GListModel *model
,GtkSorter *sorter
);
Creates a new sort list model that uses the sorter
to sort model
.
GtkSortListModel *
gtk_sort_list_model_new_for_type (GType item_type
);
Creates a new empty sort list model set up to return items of type item_type
.
It is up to the application to set a proper sort function and model to ensure
the item type is matched.
void gtk_sort_list_model_set_sorter (GtkSortListModel *self
,GtkSorter *sorter
);
Sets a new sorter on self
.
GtkSorter *
gtk_sort_list_model_get_sorter (GtkSortListModel *self
);
Gets the sorter that is used to sort self
.
void gtk_sort_list_model_set_model (GtkSortListModel *self
,GListModel *model
);
Sets the model to be sorted. The model
's item type must conform to
the item type of self
.
GListModel *
gtk_sort_list_model_get_model (GtkSortListModel *self
);
Gets the model currently sorted or NULL
if none.
“item-type”
property “item-type” GType *
The GType for items of this model
Owner: GtkSortListModel
Flags: Read / Write / Construct Only
Allowed values: GObject
“model”
property “model” GListModel *
The model being sorted
Owner: GtkSortListModel
Flags: Read / Write / Construct Only
“sorter”
property“sorter” GtkSorter *
The sorter for this model
Owner: GtkSortListModel
Flags: Read / Write