![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
\inmodule QtCore More...
#include <qabstractitemmodel.h>
Public Member Functions | |
| QPersistentModelIndex () | |
| QPersistentModelIndex (const QModelIndex &index) | |
| Creates a new QPersistentModelIndex that is a copy of the model index. | |
| QPersistentModelIndex (const QPersistentModelIndex &other) | |
| Creates a new QPersistentModelIndex that is a copy of the other persistent model index. | |
| ~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 &&other) noexcept | |
| Move-constructs a QPersistentModelIndex instance, making it point at the same object that other was pointing to. | |
| void | swap (QPersistentModelIndex &other) noexcept |
| QPersistentModelIndex & | operator= (const QModelIndex &other) |
| Sets the persistent model index to refer to the same item in a model as the other model index. | |
| operator QModelIndex () const | |
| Cast operator that returns a QModelIndex. | |
| int | row () const |
| Returns the row this persistent model index refers to. | |
| int | column () const |
| Returns the column this persistent model index refers to. | |
| void * | internalPointer () const |
| const void * | constInternalPointer () const |
| quintptr | internalId () const |
| QModelIndex | parent () const |
| Returns the parent QModelIndex for this persistent index, or an invalid QModelIndex if it has no parent. | |
| QModelIndex | sibling (int row, int column) const |
| Returns the sibling at row and column or an invalid QModelIndex if there is no sibling at this position. | |
| QVariant | data (int role=Qt::DisplayRole) const |
| Returns the data for the given role for the item referred to by the index, or a default-constructed QVariant if this persistent model index is \l{isValid()}{invalid}. | |
| void | multiData (QModelRoleDataSpan roleDataSpan) const |
| Populates the given roleDataSpan for the item referred to by the index. | |
| Qt::ItemFlags | flags () const |
| const QAbstractItemModel * | model () const |
| Returns the model that the index belongs to. | |
| bool | isValid () const |
Returns {true} if this persistent model index is valid; otherwise returns {false}. | |
Friends | |
| size_t | qHash (const QPersistentModelIndex &index, size_t seed=0) |
| bool | qHashEquals (const QPersistentModelIndex &a, const QPersistentModelIndex &b) noexcept |
| Q_CORE_EXPORT bool | comparesEqual (const QPersistentModelIndex &lhs, const QPersistentModelIndex &rhs) |
| Q_CORE_EXPORT bool | comparesEqual (const QPersistentModelIndex &lhs, const QModelIndex &rhs) |
| Q_CORE_EXPORT Qt::strong_ordering | compareThreeWay (const QPersistentModelIndex &lhs, const QPersistentModelIndex &rhs) |
| Q_CORE_EXPORT Qt::strong_ordering | compareThreeWay (const QPersistentModelIndex &lhs, const QModelIndex &rhs) |
| Q_CORE_EXPORT QDebug | operator<< (QDebug dbg, const QPersistentModelIndex &idx) |
\inmodule QtCore
The QPersistentModelIndex class is used to locate data in a data model.
\compares strong \compareswith strong QModelIndex \endcompareswith
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.
Definition at line 186 of file qabstractitemmodel.h.
| QPersistentModelIndex::QPersistentModelIndex | ( | ) |
Definition at line 338 of file qabstractitemmodel.cpp.
| QPersistentModelIndex::QPersistentModelIndex | ( | const QModelIndex & | index | ) |
Creates a new QPersistentModelIndex that is a copy of the model index.
Definition at line 360 of file qabstractitemmodel.cpp.
| QPersistentModelIndex::QPersistentModelIndex | ( | const QPersistentModelIndex & | other | ) |
Creates a new QPersistentModelIndex that is a copy of the other persistent model index.
Definition at line 350 of file qabstractitemmodel.cpp.
| QPersistentModelIndex::~QPersistentModelIndex | ( | ) |
Definition at line 375 of file qabstractitemmodel.cpp.
|
inlinenoexcept |
Move-constructs a QPersistentModelIndex instance, making it point at the same object that other was pointing to.
Definition at line 200 of file qabstractitemmodel.h.
| int QPersistentModelIndex::column | ( | ) | const |
Returns the column this persistent model index refers to.
Definition at line 526 of file qabstractitemmodel.cpp.
| const void * QPersistentModelIndex::constInternalPointer | ( | ) | const |
Returns a {const void} {*} pointer used by the model to associate the index with the internal data structure.
Definition at line 558 of file qabstractitemmodel.cpp.
| QVariant QPersistentModelIndex::data | ( | int | role = Qt::DisplayRole | ) | const |
Returns the data for the given role for the item referred to by the index, or a default-constructed QVariant if this persistent model index is \l{isValid()}{invalid}.
Definition at line 615 of file qabstractitemmodel.cpp.
| Qt::ItemFlags QPersistentModelIndex::flags | ( | ) | const |
Returns the flags for the item referred to by the index.
Definition at line 641 of file qabstractitemmodel.cpp.
| quintptr QPersistentModelIndex::internalId | ( | ) | const |
Returns a {quintptr} used by the model to associate the index with the internal data structure.
Definition at line 574 of file qabstractitemmodel.cpp.
| void * QPersistentModelIndex::internalPointer | ( | ) | const |
Returns a {void} {*} pointer used by the model to associate the index with the internal data structure.
Definition at line 542 of file qabstractitemmodel.cpp.
| bool QPersistentModelIndex::isValid | ( | ) | const |
| const QAbstractItemModel * QPersistentModelIndex::model | ( | ) | const |
Returns the model that the index belongs to.
Definition at line 651 of file qabstractitemmodel.cpp.
| void QPersistentModelIndex::multiData | ( | QModelRoleDataSpan | roleDataSpan | ) | const |
Populates the given roleDataSpan for the item referred to by the index.
Definition at line 630 of file qabstractitemmodel.cpp.
| QPersistentModelIndex::operator QModelIndex | ( | ) | const |
Cast operator that returns a QModelIndex.
Definition at line 477 of file qabstractitemmodel.cpp.
| 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.
Definition at line 458 of file qabstractitemmodel.cpp.
| 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.
Definition at line 437 of file qabstractitemmodel.cpp.
| QModelIndex QPersistentModelIndex::parent | ( | ) | const |
Returns the parent QModelIndex for this persistent index, or an invalid QModelIndex if it has no parent.
Definition at line 587 of file qabstractitemmodel.cpp.
| int QPersistentModelIndex::row | ( | ) | const |
Returns the row this persistent model index refers to.
Definition at line 513 of file qabstractitemmodel.cpp.
| QModelIndex QPersistentModelIndex::sibling | ( | int | row, |
| int | column ) const |
Returns the sibling at row and column or an invalid QModelIndex if there is no sibling at this position.
Definition at line 601 of file qabstractitemmodel.cpp.
|
inlinenoexcept |
Definition at line 203 of file qabstractitemmodel.h.
|
friend |
Definition at line 500 of file qabstractitemmodel.cpp.
|
friend |
Definition at line 399 of file qabstractitemmodel.cpp.
|
friend |
Definition at line 426 of file qabstractitemmodel.cpp.
|
friend |
Definition at line 416 of file qabstractitemmodel.cpp.
|
friend |
Definition at line 684 of file qabstractitemmodel.cpp.
References QModelIndex::QModelIndex().
|
friend |
Definition at line 245 of file qabstractitemmodel.h.
|
friend |
Definition at line 225 of file qabstractitemmodel.h.