QPersistentModelIndex Class ReferenceThe QPersistentModelIndex class is used to locate data in a data model. More... #include <QPersistentModelIndex> Public Functions
Detailed DescriptionThe 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, and QAbstractItemModel. Member Function DocumentationQPersistentModelIndex::QPersistentModelIndex ( const QModelIndex & index )Creates a new QPersistentModelIndex that is a copy of the model index. QPersistentModelIndex::QPersistentModelIndex ( const QPersistentModelIndex & other )Creates a new QPersistentModelIndex that is a copy of the other persistent model index. QModelIndex QPersistentModelIndex::child ( int row, int column ) constReturns the child of the model index that is stored in the given row and column. See also parent() and sibling(). int QPersistentModelIndex::column () constReturns the column this persistent model index refers to. QVariant QPersistentModelIndex::data ( int role = Qt::DisplayRole ) constReturns the data for the given role for the item referred to by the index. See also Qt::ItemDataRole and QAbstractItemModel::setData(). Qt::ItemFlags QPersistentModelIndex::flags () constReturns the flags for the item referred to by the index. This function was introduced in Qt 4.2. bool QPersistentModelIndex::isValid () constReturns 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. See also model(), row(), and column(). const QAbstractItemModel * QPersistentModelIndex::model () constReturns the model that the index belongs to. QModelIndex QPersistentModelIndex::parent () constReturns the parent QModelIndex for this persistent index, or an invalid QModelIndex if it has no parent. See also child(), sibling(), and model(). int QPersistentModelIndex::row () constReturns the row this persistent model index refers to. QModelIndex QPersistentModelIndex::sibling ( int row, int column ) constReturns the sibling at row and column or an invalid QModelIndex if there is no sibling at this position. See also parent() and child(). QPersistentModelIndex::operator const QModelIndex & () constCast operator that returns a const QModelIndex&. bool QPersistentModelIndex::operator!= ( const QPersistentModelIndex & other ) constReturns true if this persistent model index is not equal to the other persistent model index; otherwise returns false. This function was introduced in Qt 4.2. bool QPersistentModelIndex::operator!= ( const QModelIndex & other ) constReturns true if this persistent model index does not refer to the same location as the other model index; otherwise returns false. bool QPersistentModelIndex::operator< ( const QPersistentModelIndex & other ) constReturns 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. This function was introduced in Qt 4.1. QPersistentModelIndex & QPersistentModelIndex::operator= ( const QPersistentModelIndex & other )Sets the persistent model index to refer to the same item in a model as the other persistent model index. QPersistentModelIndex & QPersistentModelIndex::operator= ( const QModelIndex & other )Sets the persistent model index to refer to the same item in a model as the other model index. bool QPersistentModelIndex::operator== ( const QPersistentModelIndex & other ) constReturns 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. bool QPersistentModelIndex::operator== ( const QModelIndex & other ) constReturns 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. X
|
Попытка перевода Qt документации. Если есть желание присоединиться, или если есть замечания или пожелания, то заходите на форум: Перевод Qt документации на русский язык... Люди внесшие вклад в перевод: Команда переводчиков |