Skip to content

ItemSelectionRange

Qt Base Class: QItemSelectionRange

Signature: QItemSelectionRange(self) -> None QItemSelectionRange(self, QItemSelectionRange: PySide6.QtCore.QItemSelectionRange) -> None QItemSelectionRange(self, index: Union[PySide6.QtCore.QModelIndex, PySide6.QtCore.QPersistentModelIndex]) -> None QItemSelectionRange(self, topL: Union[PySide6.QtCore.QModelIndex, PySide6.QtCore.QPersistentModelIndex], bottomR: Union[PySide6.QtCore.QModelIndex, PySide6.QtCore.QPersistentModelIndex]) -> None

Base classes

Name Children Inherits
QItemSelectionRange
PySide6.QtCore
QItemSelectionRange(self) -> None

⋔ Inheritance diagram

graph TD
  1473299888224["core.ItemSelectionRange"]
  1473243634896["QtCore.QItemSelectionRange"]
  1473291690208["Shiboken.Object"]
  140713234304496["builtins.object"]
  1473243634896 --> 1473299888224
  1473291690208 --> 1473243634896
  140713234304496 --> 1473291690208

🛈 DocStrings

Bases: QItemSelectionRange

Manages information about a range of selected items in a model.

Source code in prettyqt\core\itemselectionrange.py
class ItemSelectionRange(core.QItemSelectionRange):
    """Manages information about a range of selected items in a model."""

    def __contains__(self, other: core.ModelIndex):
        return self.contains(other)

    def __bool__(self):
        return not self.isEmpty()

    def __iter__(self) -> Iterator[core.ModelIndex]:
        return iter(self.indexes())  # type: ignore

    def __len__(self):
        return len(self.indexes())

    def __and__(self, other: core.QItemSelectionRange):
        return self.intersected(other)