SortListModel

open class SortListModel(pointer: <Error class: unknown class><<Error class: unknown class>>)

A GListModel that sorts the elements of an underlying model according to a GtkSorter.

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 GtkMultiSorter 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 method@Gtk.SortListModel.set_incremental for details.

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.

Constructors

Link copied to clipboard
constructor(model: <Error class: unknown class>? = null, sorter: Sorter? = null)

Creates a new sort list model that uses the @sorter to sort @model.

constructor(pointer: <Error class: unknown class><<Error class: unknown class>>)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open val gioListModelPointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
val gtkSortListModelPointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard

If the model should sort items incrementally.

Link copied to clipboard
open var model: <Error class: unknown class>?

The model being sorted.

Link copied to clipboard
open val pending: <Error class: unknown class>

Estimate of unsorted items remaining.

Link copied to clipboard
open var sorter: Sorter?

The sorter for this model.

Functions

Link copied to clipboard

Returns whether incremental sorting is enabled.

Link copied to clipboard
open fun getModel(): <Error class: unknown class>?

Gets the model currently sorted or null if none.

Link copied to clipboard
open fun getPending(): <Error class: unknown class>

Estimates progress of an ongoing sorting operation.

Link copied to clipboard
open fun getSorter(): Sorter?

Gets the sorter that is used to sort @self.

Link copied to clipboard
open fun setIncremental(incremental: Boolean)

Sets the sort model to do an incremental sort.

Link copied to clipboard
open fun setModel(model: <Error class: unknown class>? = null)

Sets the model to be sorted.

Link copied to clipboard
open fun setSorter(sorter: Sorter? = null)

Sets a new sorter on @self.