:right-sidebar: True FlattenListModel =================================================================== .. currentmodule:: gi.repository.Gtk .. class:: FlattenListModel(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.GObject.Object` Implemented Interfaces: :class:`~gi.repository.Gio.ListModel`, :class:`~gi.repository.Gtk.SectionModel` :Constructors: :: FlattenListModel(**properties) new(model:Gio.ListModel=None) -> Gtk.FlattenListModel Constructors ------------ .. rst-class:: interim-class .. class:: FlattenListModel :no-index: .. classmethod:: new(model: ~gi.repository.Gio.ListModel | None = None) -> ~gi.repository.Gtk.FlattenListModel Creates a new ``GtkFlattenListModel`` that flattens ``list``. :param model: the model to be flattened Methods ------- .. rst-class:: interim-class .. class:: FlattenListModel :no-index: .. method:: get_model() -> ~gi.repository.Gio.ListModel | None Gets the model set via :func:`~gi.repository.Gtk.FlattenListModel.set_model`. .. method:: get_model_for_item(position: int) -> ~gi.repository.Gio.ListModel | None Returns the model containing the item at the given position. :param position: a position .. method:: set_model(model: ~gi.repository.Gio.ListModel | None = None) -> None Sets a new model to be flattened. :param model: the new model Properties ---------- .. rst-class:: interim-class .. class:: FlattenListModel :no-index: .. attribute:: props.item_type :type: type The type of items. See :obj:`~gi.repository.Gio.ListModel.get_item_type`. .. versionadded:: 4.8 .. attribute:: props.model :type: ~gi.repository.Gio.ListModel The model being flattened. .. attribute:: props.n_items :type: int The number of items. See :obj:`~gi.repository.Gio.ListModel.get_n_items`. .. versionadded:: 4.8