Interface that adds support for section to list models.
This support is then used by widgets using list models to be able to group their items into sections.
Many GTK list models support sections inherently, or they pass through the sections of a model they are wrapping.
A Gtk::SectionModel groups successive items into so-called sections. List widgets like Gtk::ListView then allow displaying section headers for these sections.
When the section groupings of a model changes, the model will emit signal_sections_changed() by calling the sections_changed() function. All sections in the given range now need to be queried again.
Gio::ListModel::signal_items_changed() has the same effect, all sections in that range are invalidated, too.
- See also
- Gio::ListModel, Gtk::ListView
- Since gtkmm 4.12:
| void Gtk::SectionModel::sections_changed |
( |
guint |
position, |
|
|
guint |
n_items |
|
) |
| |
This function emits the signal_sections_changed() signal to notify about changes to sections.
It must cover all positions that used to be a section start or that are now a section start. It does not have to cover all positions for which the section has changed.
The Gio::ListModel::signal_items_changed() implies the effect of the signal_sections_changed() signal for all the items it covers.
It is recommended that when changes to the items cause section changes in a larger range, that the larger range is included in the emission of the Gio::ListModel::signal_items_changed() instead of emitting two signals.
- Since gtkmm 4.12:
- Parameters
-
| position | The first changed item. |
| n_items | The number of changed items. |
| Glib::SignalProxy< void(guint, guint)> Gtk::SectionModel::signal_sections_changed |
( |
| ) |
|
- Slot Prototype:
void on_my_sections_changed(guint position, guint n_items)
Flags: Run Last
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 Gio::ListModel::signal_items_changed() implies the effect of the signal_sections_changed() signal for all the items it covers.
- Since gtkmm 4.12:
- Parameters
-
| position | The first item that may have changed. |
| n_items | Number of items with changes. |