QPersistentModelIndex Class
The QPersistentModelIndex class is used to locate data in a data model. More...
| Header: | #include <QPersistentModelIndex> |
| qmake: | QT += core |
Detailed Description
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.
Note: You cannot store a QStandardItemModel's QPersistentModelIndex in one of the model's items.
See also Model/View Programming, QModelIndex, and QAbstractItemModel.