Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
|
#include <qabstractitemmodel_p.h>
Public Member Functions | |
Persistent () | |
void | insertMultiAtEnd (const QModelIndex &key, QPersistentModelIndexData *data) |
Public Attributes | |
QMultiHash< QModelIndex, QPersistentModelIndexData * > | indexes |
QStack< QList< QPersistentModelIndexData * > > | moved |
QStack< QList< QPersistentModelIndexData * > > | invalidated |
Definition at line 110 of file qabstractitemmodel_p.h.
|
inline |
Definition at line 111 of file qabstractitemmodel_p.h.
void QAbstractItemModelPrivate::Persistent::insertMultiAtEnd | ( | const QModelIndex & | key, |
QPersistentModelIndexData * | data ) |
QMultiHash::insert inserts the value before the old value. and find() return the new value. We need insertMultiAtEnd because we don't want to overwrite the old one, which should be removed later
There should be only one instance QPersistentModelIndexData per index, but in some intermediate state there may be severals of PersistantModelIndex pointing to the same index, but one is already updated, and the other one is not. This make sure than when updating the first one we don't overwrite the second one in the hash, and the second one will be updated right later.
Definition at line 4158 of file qabstractitemmodel.cpp.
References QMultiHash< Key, T >::end(), indexes, QMultiHash< Key, T >::insert(), it, and qSwap().
QMultiHash<QModelIndex, QPersistentModelIndexData *> QAbstractItemModelPrivate::Persistent::indexes |
Definition at line 112 of file qabstractitemmodel_p.h.
Referenced by insertMultiAtEnd().
QStack<QList<QPersistentModelIndexData *> > QAbstractItemModelPrivate::Persistent::invalidated |
Definition at line 114 of file qabstractitemmodel_p.h.
QStack<QList<QPersistentModelIndexData *> > QAbstractItemModelPrivate::Persistent::moved |
Definition at line 113 of file qabstractitemmodel_p.h.