Filter#
Superclasses: Object
Subclasses: BoolFilter, CustomFilter, FileFilter, MultiFilter, StringFilter
A GtkFilter object describes the filtering to be performed by a
FilterListModel.
The model will use the filter to determine if it should include items
or not by calling match for each item and only
keeping the ones that the function returns True for.
Filters may change what items they match through their lifetime. In that
case, they will emit the changed signal to notify
that previous filter results are no longer valid and that items should
be checked again via match.
GTK provides various pre-made filter implementations for common filtering operations. These filters often include properties that can be linked to various widgets to easily allow searches.
However, in particular for large lists or complex search methods, it is
also possible to subclass GtkFilter and provide one’s own filter.
Methods#
- class Filter
- changed(change: FilterChange) None#
Notifies all users of the filter that it has changed.
This emits the
changedsignal. Users of the filter should then check items again viamatch.Depending on the
changeparameter, not all items need to be changed, but only some. Refer to theFilterChangedocumentation for details.This function is intended for implementers of
GtkFiltersubclasses and should not be called from other functions.- Parameters:
change – How the filter changed
- do_get_strictness(self) FilterMatch#
- get_strictness() FilterMatch#
Gets the known strictness of
filters.If the strictness is not known,
SOMEis returned.This value may change after emission of the
changedsignal.This function is meant purely for optimization purposes, filters can choose to omit implementing it, but
GtkFilterListModeluses it.
Signals#
- class Filter.signals
- changed(change: FilterChange) None#
Emitted whenever the filter changed.
Users of the filter should then check items again via
match.GtkFilterListModelhandles this signal automatically.Depending on the
changeparameter, not all items need to be checked, but only some. Refer to theFilterChangedocumentation for details.- Parameters:
change – how the filter changed
Virtual Methods#
- class Filter
- do_get_strictness() FilterMatch#
Gets the known strictness of
filters.If the strictness is not known,
SOMEis returned.This value may change after emission of the
changedsignal.This function is meant purely for optimization purposes, filters can choose to omit implementing it, but
GtkFilterListModeluses it.
Fields#
- class Filter
- parent_instance#