Trait gtk4::prelude::SectionModelExt

source ·
pub trait SectionModelExt: IsA<SectionModel> + Sealed + 'static {
    // Provided methods
    fn section(&self, position: u32) -> (u32, u32) { ... }
    fn sections_changed(&self, position: u32, n_items: u32) { ... }
    fn connect_sections_changed<F: Fn(&Self, u32, u32) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId { ... }
}
Available on crate feature v4_12 only.
Expand description

Provided Methods§

source

fn section(&self, position: u32) -> (u32, u32)

Query the section that covers the given position. The number of items in the section can be computed by out_end - out_start.

If the position is larger than the number of items, a single range from n_items to G_MAXUINT will be returned.

§position

the position of the item to query

§Returns
§out_start

the position of the first item in the section

§out_end

the position of the first item not part of the section anymore.

source

fn sections_changed(&self, position: u32, n_items: u32)

source

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

Emitted when the start-of-section state of some of the items in @model changes.

Note that this signal does not specify the new section state of the items, they need to be queried manually. It is also not necessary for a model to change the section state of any of the items in the section model, though it would be rather useless to emit such a signal.

The items-changed implies the effect of the sections-changed signal for all the items it covers.

§position

The first item that may have changed

§n_items

number of items with changes

Object Safety§

This trait is not object safe.

Implementors§