pub trait SorterExt:
IsA<Sorter>
+ Sealed
+ 'static {
// Provided methods
fn changed(&self, change: SorterChange) { ... }
fn compare(
&self,
item1: &impl IsA<Object>,
item2: &impl IsA<Object>,
) -> Ordering { ... }
fn order(&self) -> SorterOrder { ... }
fn connect_changed<F: Fn(&Self, SorterChange) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
}
Expand description
Trait containing all Sorter
methods.
§Implementors
ColumnViewSorter
, CustomSorter
, MultiSorter
, NumericSorter
, Sorter
, StringSorter
, TreeListRowSorter
Provided Methods§
Sourcefn changed(&self, change: SorterChange)
fn changed(&self, change: SorterChange)
Notifies all users of the sorter that it has changed.
This emits the changed
signal. Users
of the sorter should then update the sort order via
Gtk::Sorter::compare()
.
Depending on the @change parameter, it may be possible to
update the sort order without a full resorting. Refer to
the SorterChange
documentation for details.
This function is intended for implementers of Sorter
subclasses and should not be called from other functions.
§change
How the sorter changed
fn compare( &self, item1: &impl IsA<Object>, item2: &impl IsA<Object>, ) -> Ordering
Sourcefn order(&self) -> SorterOrder
fn order(&self) -> SorterOrder
Gets the order that @self conforms to.
See SorterOrder
for details
of the possible return values.
This function is intended to allow optimizations.
§Returns
The order
Sourcefn connect_changed<F: Fn(&Self, SorterChange) + 'static>(
&self,
f: F,
) -> SignalHandlerId
fn connect_changed<F: Fn(&Self, SorterChange) + 'static>( &self, f: F, ) -> SignalHandlerId
Emitted whenever the sorter changed.
Users of the sorter should then update the sort order again via gtk_sorter_compare().
SortListModel
handles this signal automatically.
Depending on the @change parameter, it may be possible to update
the sort order without a full resorting. Refer to the
SorterChange
documentation for details.
§change
how the sorter changed
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.