内容表

上一话题

QPauseAnimation

下一话题

QPluginLoader

QPersistentModelIndex

QPersistentModelIndex class is used to locate data in a data model. 更多

Inheritance diagram of PySide2.QtCore.QPersistentModelIndex

概要

函数

详细描述

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.

注意

You cannot store a QStandardItemModel ‘s QPersistentModelIndex in one of the model’s items.

class QPersistentModelIndex

QPersistentModelIndex(index)

QPersistentModelIndex(other)

参数
PySide2.QtCore.QPersistentModelIndex. child ( row , column )
参数
  • row int

  • column int

返回类型

QModelIndex

注意

此函数被弃用。

使用 index() 代替。

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

PySide2.QtCore.QPersistentModelIndex. column ( )
返回类型

int

Returns the column this persistent model index refers to.

PySide2.QtCore.QPersistentModelIndex. data ( [ role=Qt.DisplayRole ] )
参数

role int

返回类型

object

返回数据为给定 role for the item referred to by the index.

另请参阅

ItemDataRole setData()

PySide2.QtCore.QPersistentModelIndex. flags ( )
返回类型

ItemFlags

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

PySide2.QtCore.QPersistentModelIndex. internalId ( )
返回类型

quintptr

PySide2.QtCore.QPersistentModelIndex. internalPointer ( )
返回类型

void

PySide2.QtCore.QPersistentModelIndex. isValid ( )
返回类型

bool

返回 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.

PySide2.QtCore.QPersistentModelIndex. model ( )
返回类型

QAbstractItemModel

Returns the model that the index belongs to.

PySide2.QtCore.QPersistentModelIndex. __ne__ ( other )
参数

other QModelIndex

返回类型

bool

PySide2.QtCore.QPersistentModelIndex. __ne__ ( other )
参数

other QPersistentModelIndex

返回类型

bool

PySide2.QtCore.QPersistentModelIndex. __lt__ ( other )
参数

other QPersistentModelIndex

返回类型

bool

PySide2.QtCore.QPersistentModelIndex.operator=(other)
参数

other QModelIndex

返回类型

QPersistentModelIndex

PySide2.QtCore.QPersistentModelIndex. __eq__ ( other )
参数

other QModelIndex

返回类型

bool

PySide2.QtCore.QPersistentModelIndex. __eq__ ( other )
参数

other QPersistentModelIndex

返回类型

bool

PySide2.QtCore.QPersistentModelIndex. parent ( )
返回类型

QModelIndex

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

PySide2.QtCore.QPersistentModelIndex. row ( )
返回类型

int

Returns the row this persistent model index refers to.

PySide2.QtCore.QPersistentModelIndex. sibling ( row , column )
参数
  • row int

  • column int

返回类型

QModelIndex

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

另请参阅

parent()

PySide2.QtCore.QPersistentModelIndex. swap ( other )
参数

other QPersistentModelIndex

Swaps this persistent modelindex with other 。此函数非常快,且从不失败。