Trait gtk4::prelude::FilterExt

source ·
pub trait FilterExt: IsA<Filter> + Sealed + 'static {
    // Provided methods
    fn changed(&self, change: FilterChange) { ... }
    fn strictness(&self) -> FilterMatch { ... }
    fn match_(&self, item: &impl IsA<Object>) -> bool { ... }
    fn connect_changed<F: Fn(&Self, FilterChange) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId { ... }
}
Expand description

Provided Methods§

source

fn changed(&self, change: FilterChange)

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 implementors of Filter subclasses and should not be called from other functions.

change

How the filter changed

source

fn strictness(&self) -> FilterMatch

Gets the known strictness of @filters.

If the strictness is not known, FilterMatch::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 FilterListModel uses it.

Returns

the strictness of @self

source

fn match_(&self, item: &impl IsA<Object>) -> bool

source

fn connect_changed<F: Fn(&Self, FilterChange) + 'static>( &self, f: F ) -> SignalHandlerId

Emitted whenever the filter changed.

Users of the filter should then check items again via match_().

FilterListModel 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.

change

how the filter changed

Implementors§

source§

impl<O: IsA<Filter>> FilterExt for O