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>.
Loading...
Searching...
No Matches
QAbstractItemModelPrivate::Persistent Struct Reference

#include <qabstractitemmodel_p.h>

+ Collaboration diagram for QAbstractItemModelPrivate::Persistent:

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
 

Detailed Description

Definition at line 110 of file qabstractitemmodel_p.h.

Constructor & Destructor Documentation

◆ Persistent()

QAbstractItemModelPrivate::Persistent::Persistent ( )
inline

Definition at line 111 of file qabstractitemmodel_p.h.

Member Function Documentation

◆ insertMultiAtEnd()

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().

+ Here is the call graph for this function:

Member Data Documentation

◆ indexes

QMultiHash<QModelIndex, QPersistentModelIndexData *> QAbstractItemModelPrivate::Persistent::indexes

Definition at line 112 of file qabstractitemmodel_p.h.

Referenced by insertMultiAtEnd().

◆ invalidated

QStack<QList<QPersistentModelIndexData *> > QAbstractItemModelPrivate::Persistent::invalidated

Definition at line 114 of file qabstractitemmodel_p.h.

◆ moved

QStack<QList<QPersistentModelIndexData *> > QAbstractItemModelPrivate::Persistent::moved

Definition at line 113 of file qabstractitemmodel_p.h.


The documentation for this struct was generated from the following files: