[17:7] extends: object
A list model that filters the elements of another model. It hides some
elements from the underlying model according to criteria given by a
GtkFilter. The model can be set up to do incremental filtering, so that
filtering long lists doesn't block the UI. See
[method@Gtk.FilterListModel.set_incremental] for details.
GtkFilterListModel passes through sections from the underlying model.
FilterListModel (model = null, filter = null)
Creates a new
GtkFilterListModelthat will filter @model using the given @filter.
model is the model to sort.filter is filter.toNativeHandle (Source)
Normalizes a constructor argument into a raw pointer carrier. Accepts a raw NativeHandle, a raw NativeBuffer returned from
fn.call(...), another generated wrapper exposinghandle(), or null. Returns null when the argument carries no pointer.
Source is the raw handle, raw buffer, wrapper, or null.A raw pointer carrier or null when no pointer is present.getLib ()
Returns the opened native library for this generated wrapper.
The opened native library.handle ()
Returns the wrapped NativeHandle.
The wrapped NativeHandle.isNull ()
Returns true when the wrapped handle is null.
A bool.describe ()
Returns a small string for debugging generated wrappers.
A string.asObject ()
Wraps this handle as
Object.
A Object object.asListModel ()
Wraps this handle as
ListModel.
A ListModel object.asSectionModel ()
Wraps this handle as
SectionModel.
A SectionModel object.getProperty (string Name)
Reads one generated property by name.
setProperty (string Name, Value)
Writes one generated property by name.
setFilter (object Value)
The filter for this model.
Value is the new property value.None.setIncremental (bool Value)
If the model should filter items incrementally.
Value is the new property value.None.setModel (object Value)
The model being filtered.
Value is the new property value.None.setWatchitems (bool Value)
Monitor the list items for changes. It may impact performance.
Value is the new property value.None.get_filter ()
Gets the
GtkFiltercurrently set on @self.
get_incremental ()
Returns whether incremental filtering is enabled. See [method@Gtk.FilterListModel.set_incremental].
get_model ()
Gets the model currently filtered or %NULL if none.
get_pending ()
Returns the number of items that have not been filtered yet. You can use this value to check if @self is busy filtering by comparing the return value to 0 or you can compute the percentage of the filter remaining by dividing the return value by the total number of items in the underlying model:
c pending = gtk_filter_list_model_get_pending (self); model = gtk_filter_list_model_get_model (self); percentage = pending / (double) g_list_model_get_n_items (model);If no filter operation is ongoing - in particular when [property@Gtk.FilterListModel:incremental] is %FALSE - this function returns 0.
get_watch_items ()
Returns whether watching items is enabled. See [method@Gtk.FilterListModel.set_watch_items].
set_filter (object filter)
Sets the filter used to filter items.
filter is filter to use.None.set_incremental (bool incremental)
Sets the filter model to do an incremental sort. When incremental filtering is enabled, the
GtkFilterListModelwill not run filters immediately, but will instead queue an idle handler that incrementally filters the items and adds them to the list. This of course means that items are not instantly added to the list, but only appear incrementally. When your filter blocks the UI while filtering, you might consider turning this on. Depending on your model and filters, this may become interesting around 10,000 to 100,000 items. By default, incremental filtering is disabled. See [method@Gtk.FilterListModel.get_pending] for progress information about an ongoing incremental filtering operation.
incremental is %TRUE to enable incremental filtering.None.set_model (object model)
Sets the model to be filtered. Note that GTK makes no effort to ensure that @model conforms to the item type of @self. It assumes that the caller knows what they are doing and have set up an appropriate filter to ensure that item types match.
model is The model to be filtered.None.set_watch_items (bool watch_items)
Sets the filter model to monitor properties of its items. This allows implementations of [class@Gtk.Filter] that support expression watching to react to property changes. This property has no effect if the current filter doesn't support watching items. By default, watching items is disabled.
watch_items is %TRUE to watch items for property changes.None.model ()
Returns
get_modelas an Aussom list of wrapper objects. This companion method materializes the full collection up front; useget_model()when lazy or change-notify access is required.
An Aussom list of elements.[340:14] static extends: object
Generated metadata helpers for FilterListModel class surfaces.
properties ()
Returns property metadata for
FilterListModel.
A list.