QPersistentModelIndex — PyQt Documentation v5.15.7 (original) (raw)
PyQt5.QtCore.QPersistentModelIndex
Description¶
The QPersistentModelIndex class is used to locate data in a data model.
A QPersistentModelIndex is a model index that can be stored by an application, and later used to access information in a model. Unlike the QModelIndex class, it is safe to store a QPersistentModelIndex since the model will ensure that references to items will continue to be valid as long as they can be accessed by the model.
It is good practice to check that persistent model indexes are valid before using them.
See also
Model/View Programming, QModelIndex, QAbstractItemModel.
Methods¶
__init__()
TODO
__init__(QModelIndex)
Creates a new QPersistentModelIndex that is a copy of the model index.
__init__(QPersistentModelIndex)
TODO
child(int, int) → QModelIndex
TODO
column() → int
TODO
data(role: int = Qt.ItemDataRole.DisplayRole) → Any
TODO
__eq__(QPersistentModelIndex) → bool
TODO
__eq__(QModelIndex) → bool
TODO
flags() → ItemFlags
Returns the flags for the item referred to by the index.
__ge__(QPersistentModelIndex) → bool
TODO
__hash__() → int
TODO
isValid() → bool
TODO
__lt__(QPersistentModelIndex) → bool
TODO
model() → QAbstractItemModel
Returns the model that the index belongs to.
__ne__(QPersistentModelIndex) → bool
TODO
__ne__(QModelIndex) → bool
TODO
parent() → QModelIndex
Returns the parent QModelIndex for this persistent index, or an invalid QModelIndex if it has no parent.
See also
row() → int
TODO
sibling(int, int) → QModelIndex
Returns the sibling at row and column or an invalid QModelIndex if there is no sibling at this position.
See also
swap(QPersistentModelIndex)
TODO