Table Of Contents

Previous topic

QBasicTimer

Next topic

QModelIndex

QPersistentModelIndex

Inheritance diagram of QPersistentModelIndex

Synopsis

Functions

Detailed Description

The PySide.QtCore.QPersistentModelIndex class is used to locate data in a data model.

A PySide.QtCore.QPersistentModelIndex is a model index that can be stored by an application, and later used to access information in a model. Unlike the PySide.QtCore.QModelIndex class, it is safe to store a PySide.QtCore.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.

class PySide.QtCore.QPersistentModelIndex
class PySide.QtCore.QPersistentModelIndex(index)
class PySide.QtCore.QPersistentModelIndex(other)
Parameters:

Creates a new PySide.QtCore.QPersistentModelIndex that is a copy of the model index .

Creates a new PySide.QtCore.QPersistentModelIndex that is a copy of the other persistent model index.

PySide.QtCore.QPersistentModelIndex.child(row, column)
Parameters:
  • rowPySide.QtCore.int
  • columnPySide.QtCore.int
Return type:

PySide.QtCore.QModelIndex

Returns the child of the model index that is stored in the given row and column .

PySide.QtCore.QPersistentModelIndex.column()
Return type:PySide.QtCore.int

Returns the column this persistent model index refers to.

PySide.QtCore.QPersistentModelIndex.data([role=Qt.DisplayRole])
Parameters:rolePySide.QtCore.int
Return type:object

Returns the data for the given role for the item referred to by the index.

See also

Qt.ItemDataRole QAbstractItemModel.setData()

PySide.QtCore.QPersistentModelIndex.flags()
Return type:PySide.QtCore.Qt.ItemFlags

Returns the flags for the item referred to by the index.

PySide.QtCore.QPersistentModelIndex.internalId()
Return type:PySide.QtCore.qint64

Returns a qint64 used by the model to associate the index with the internal data structure.

PySide.QtCore.QPersistentModelIndex.internalPointer()
Return type:void

Returns a void* pointer used by the model to associate the index with the internal data structure.

PySide.QtCore.QPersistentModelIndex.isValid()
Return type:PySide.QtCore.bool

Returns true if this persistent model index is valid; otherwise returns false.

A valid index belongs to a model, and has non-negative row and column numbers.

PySide.QtCore.QPersistentModelIndex.model()
Return type:PySide.QtCore.QAbstractItemModel

Returns the model that the index belongs to.

PySide.QtCore.QPersistentModelIndex.__ne__(other)
Parameters:otherPySide.QtCore.QModelIndex
Return type:PySide.QtCore.bool

Returns true if this persistent model index does not refer to the same location as the other model index; otherwise returns false.

PySide.QtCore.QPersistentModelIndex.__ne__(other)
Parameters:otherPySide.QtCore.QPersistentModelIndex
Return type:PySide.QtCore.bool

Returns true if this persistent model index is not equal to the other persistent model index; otherwise returns false.

PySide.QtCore.QPersistentModelIndex.__lt__(other)
Parameters:otherPySide.QtCore.QPersistentModelIndex
Return type:PySide.QtCore.bool

Returns true if this persistent model index is smaller than the other persistent model index; otherwise returns false.

All values in the persistent model index are used when comparing with another persistent model index.

PySide.QtCore.QPersistentModelIndex.__eq__(other)
Parameters:otherPySide.QtCore.QPersistentModelIndex
Return type:PySide.QtCore.bool

Returns true if this persistent model index is equal to the other persistent model index; otherwise returns false.

All values in the persistent model index are used when comparing with another persistent model index.

PySide.QtCore.QPersistentModelIndex.__eq__(other)
Parameters:otherPySide.QtCore.QModelIndex
Return type:PySide.QtCore.bool

Returns true if this persistent model index refers to the same location as the other model index; otherwise returns false.

All values in the persistent model index are used when comparing with another model index.

PySide.QtCore.QPersistentModelIndex.parent()
Return type:PySide.QtCore.QModelIndex

Returns the parent PySide.QtCore.QModelIndex for this persistent index, or an invalid PySide.QtCore.QModelIndex if it has no parent.

PySide.QtCore.QPersistentModelIndex.row()
Return type:PySide.QtCore.int

Returns the row this persistent model index refers to.

PySide.QtCore.QPersistentModelIndex.sibling(row, column)
Parameters:
  • rowPySide.QtCore.int
  • columnPySide.QtCore.int
Return type:

PySide.QtCore.QModelIndex

Returns the sibling at row and column or an invalid PySide.QtCore.QModelIndex if there is no sibling at this position.