:right-sidebar: True SelectionFilterModel =================================================================== .. currentmodule:: gi.repository.Gtk .. class:: SelectionFilterModel(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.GObject.Object` Implemented Interfaces: :class:`~gi.repository.Gio.ListModel` ``GtkSelectionFilterModel`` is a list model that presents the selection from a ``GtkSelectionModel``. Constructors ------------ .. rst-class:: interim-class .. class:: SelectionFilterModel :no-index: .. classmethod:: new(model: ~gi.repository.Gtk.SelectionModel | None = None) -> ~gi.repository.Gtk.SelectionFilterModel Creates a new ``GtkSelectionFilterModel`` that will include the selected items from the underlying selection model. :param model: the selection model to filter Methods ------- .. rst-class:: interim-class .. class:: SelectionFilterModel :no-index: .. method:: get_model() -> ~gi.repository.Gtk.SelectionModel | None Gets the model currently filtered or :const:`None` if none. .. method:: set_model(model: ~gi.repository.Gtk.SelectionModel | None = None) -> None Sets the model to be filtered. Note that GTK makes no effort to ensure that ``model`` conforms to the item type of ``self``. It assumes that the caller knows what they are doing and have set up an appropriate filter to ensure that item types match. :param model: The model to be filtered Properties ---------- .. rst-class:: interim-class .. class:: SelectionFilterModel :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.Gtk.SelectionModel The model being filtered. .. attribute:: props.n_items :type: int The number of items. See :obj:`~gi.repository.Gio.ListModel.get_n_items`. .. versionadded:: 4.8