:right-sidebar: True MultiSorter =================================================================== .. currentmodule:: gi.repository.Gtk .. class:: MultiSorter(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.Gtk.Sorter`, :class:`~gi.repository.GObject.Object` Implemented Interfaces: :class:`~gi.repository.Gio.ListModel`, :class:`~gi.repository.Gtk.Buildable` ``GtkMultiSorter`` combines multiple sorters by trying them in turn. If the first sorter compares two items as equal, the second is tried next, and so on. Constructors ------------ .. rst-class:: interim-class .. class:: MultiSorter :no-index: .. classmethod:: new() -> ~gi.repository.Gtk.MultiSorter Creates a new multi sorter. This sorter compares items by trying each of the sorters in turn, until one returns non-zero. In particular, if no sorter has been added to it, it will always compare items as equal. Methods ------- .. rst-class:: interim-class .. class:: MultiSorter :no-index: .. method:: append(sorter: ~gi.repository.Gtk.Sorter) -> None Add ``sorter`` to ``self`` to use for sorting at the end. ``self`` will consult all existing sorters before it will sort with the given ``sorter``. :param sorter: a sorter to add .. method:: remove(position: int) -> None Removes the sorter at the given ``position`` from the list of sorter used by ``self``. If ``position`` is larger than the number of sorters, nothing happens. :param position: position of sorter to remove Properties ---------- .. rst-class:: interim-class .. class:: MultiSorter :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.n_items :type: int The number of items. See :obj:`~gi.repository.Gio.ListModel.get_n_items`. .. versionadded:: 4.8