Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
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< QtPrivate::QModelIndexWrapper, QPersistentModelIndexData * > indexes
 
QStack< QList< QPersistentModelIndexData * > > moved
 
QStack< QList< QPersistentModelIndexData * > > invalidated
 

Detailed Description

Definition at line 132 of file qabstractitemmodel_p.h.

Constructor & Destructor Documentation

◆ Persistent()

QAbstractItemModelPrivate::Persistent::Persistent ( )
inline

Definition at line 133 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 4178 of file qabstractitemmodel.cpp.

Member Data Documentation

◆ indexes

QMultiHash<QtPrivate::QModelIndexWrapper, QPersistentModelIndexData *> QAbstractItemModelPrivate::Persistent::indexes

Definition at line 134 of file qabstractitemmodel_p.h.

◆ invalidated

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

Definition at line 136 of file qabstractitemmodel_p.h.

◆ moved

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

Definition at line 135 of file qabstractitemmodel_p.h.


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