Filter

class Filter(**properties: Any)

Superclasses: Object

Subclasses: BoolFilter, CustomFilter, FileFilter, MultiFilter, StringFilter

Constructors:

Filter(**properties)

Methods

class Filter
changed(change: FilterChange) None

Notifies all users of the filter that it has changed.

This emits the changed signal. Users of the filter should then check items again via match.

Depending on the change parameter, not all items need to be changed, but only some. Refer to the FilterChange documentation for details.

This function is intended for implementers of GtkFilter subclasses and should not be called from other functions.

Parameters:

change – How the filter changed

get_strictness() FilterMatch

Gets the known strictness of filters.

If the strictness is not known, SOME is returned.

This value may change after emission of the changed signal.

This function is meant purely for optimization purposes, filters can choose to omit implementing it, but GtkFilterListModel uses it.

match(item: Object) bool

Checks if the given item is matched by the filter or not.

Parameters:

item – The item to check

Signals

class Filter.signals
changed(change: FilterChange) None

Emitted whenever the filter changed.

Users of the filter should then check items again via match.

GtkFilterListModel handles this signal automatically.

Depending on the change parameter, not all items need to be checked, but only some. Refer to the FilterChange documentation 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, SOME is returned.

This value may change after emission of the changed signal.

This function is meant purely for optimization purposes, filters can choose to omit implementing it, but GtkFilterListModel uses it.

do_match(item: Object | None = None) bool

Checks if the given item is matched by the filter or not.

Parameters:

item – The item to check

Fields

class Filter
parent_instance