Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
QAbstractItemModelPrivate Class Reference

#include <qabstractitemmodel_p.h>

+ Inheritance diagram for QAbstractItemModelPrivate:
+ Collaboration diagram for QAbstractItemModelPrivate:

Classes

struct  Change
 
struct  Persistent
 

Public Member Functions

 QAbstractItemModelPrivate ()
 
 ~QAbstractItemModelPrivate ()
 
void removePersistentIndexData (QPersistentModelIndexData *data)
 
void movePersistentIndexes (const QList< QPersistentModelIndexData * > &indexes, int change, const QModelIndex &parent, Qt::Orientation orientation)
 
void rowsAboutToBeInserted (const QModelIndex &parent, int first, int last)
 
void rowsInserted (const QModelIndex &parent, int first, int last)
 
void rowsAboutToBeRemoved (const QModelIndex &parent, int first, int last)
 
void rowsRemoved (const QModelIndex &parent, int first, int last)
 
void columnsAboutToBeInserted (const QModelIndex &parent, int first, int last)
 
void columnsInserted (const QModelIndex &parent, int first, int last)
 
void columnsAboutToBeRemoved (const QModelIndex &parent, int first, int last)
 
void columnsRemoved (const QModelIndex &parent, int first, int last)
 
void itemsAboutToBeMoved (const QModelIndex &srcParent, int srcFirst, int srcLast, const QModelIndex &destinationParent, int destinationChild, Qt::Orientation)
 
void itemsMoved (const QModelIndex &srcParent, int srcFirst, int srcLast, const QModelIndex &destinationParent, int destinationChild, Qt::Orientation orientation)
 
bool allowMove (const QModelIndex &srcParent, int srcFirst, int srcLast, const QModelIndex &destinationParent, int destinationChild, Qt::Orientation orientation)
 Returns whether a move operation is valid.
 
virtual void executePendingOperations () const
 
QModelIndex createIndex (int row, int column, void *data=nullptr) const
 
QModelIndex createIndex (int row, int column, int id) const
 
bool indexValid (const QModelIndex &index) const
 
void invalidatePersistentIndexes ()
 
void invalidatePersistentIndex (const QModelIndex &index)
 
- Public Member Functions inherited from QObjectPrivate
void ensureExtraData ()
 
 QObjectPrivate (int version=QObjectPrivateVersion)
 
virtual ~QObjectPrivate ()
 
void deleteChildren ()
 
void clearBindingStorage ()
 
void checkForIncompatibleLibraryVersion (int version) const
 
void setParent_helper (QObject *)
 
void moveToThread_helper ()
 
void setThreadData_helper (QThreadData *currentData, QThreadData *targetData, QBindingStatus *status)
 
void _q_reregisterTimers (void *pointer)
 
bool isSender (const QObject *receiver, const char *signal) const
 
QObjectList receiverList (const char *signal) const
 
QObjectList senderList () const
 
void ensureConnectionData ()
 
void addConnection (int signal, Connection *c)
 
int signalIndex (const char *signalName, const QMetaObject **meta=nullptr) const
 
bool isSignalConnected (uint signalIdx, bool checkDeclarative=true) const
 
bool maybeSignalConnected (uint signalIndex) const
 
bool isDeclarativeSignalConnected (uint signalIdx) const
 
void connectNotify (const QMetaMethod &signal)
 
void disconnectNotify (const QMetaMethod &signal)
 
void reinitBindingStorageAfterThreadMove ()
 
virtual std::string flagsForDumping () const
 
QtPrivate::QPropertyAdaptorSlotObjectgetPropertyAdaptorSlotObject (const QMetaProperty &property)
 
- Public Member Functions inherited from QObjectData
 QObjectData ()=default
 
virtual ~QObjectData ()=0
 
QMetaObjectdynamicMetaObject () const
 

Static Public Member Functions

static QAbstractItemModelstaticEmptyModel ()
 
static bool variantLessThan (const QVariant &v1, const QVariant &v2)
 
static const QHash< int, QByteArray > & defaultRoleNames ()
 
static bool isVariantLessThan (const QVariant &left, const QVariant &right, Qt::CaseSensitivity cs=Qt::CaseSensitive, bool isLocaleAware=false)
 
- Static Public Member Functions inherited from QObjectPrivate
static bool removeConnection (Connection *c)
 
static QObjectPrivateget (QObject *o)
 
static const QObjectPrivateget (const QObject *o)
 
template<typename Func1 , typename Func2 >
static QMetaObject::Connection connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiverPrivate, Func2 slot, Qt::ConnectionType type=Qt::AutoConnection)
 
template<typename Func1 , typename Func2 >
static bool disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiverPrivate, Func2 slot)
 
static QMetaObject::Connection connectImpl (const QObject *sender, int signal_index, const QObject *receiver, void **slot, QtPrivate::QSlotObjectBase *slotObj, int type, const int *types, const QMetaObject *senderMetaObject)
 
static QMetaObject::Connection connect (const QObject *sender, int signal_index, QtPrivate::QSlotObjectBase *slotObj, Qt::ConnectionType type)
 
static QMetaObject::Connection connect (const QObject *sender, int signal_index, const QObject *receiver, QtPrivate::QSlotObjectBase *slotObj, Qt::ConnectionType type)
 
static bool disconnect (const QObject *sender, int signal_index, void **slot)
 
static bool disconnect (const QObject *sender, int signal_index, const QObject *receiver, void **slot)
 

Public Attributes

QStack< Changechanges
 
struct QAbstractItemModelPrivate::Persistent persistent
 
- Public Attributes inherited from QObjectPrivate
ExtraDataextraData
 
QAtomicPointer< QThreadDatathreadData
 
QAtomicPointer< ConnectionDataconnections
 
union { 
 
   QObject *   currentChildBeingDeleted 
 
   QAbstractDeclarativeData *   declarativeData 
 
};  
 
QAtomicPointer< QtSharedPointer::ExternalRefCountDatasharedRefcount
 
- Public Attributes inherited from QObjectData
QObjectq_ptr
 
QObjectparent
 
QObjectList children
 
uint isWidget: 1
 
uint blockSig: 1
 
uint wasDeleted: 1
 
uint isDeletingChildren: 1
 
uint sendChildEvents: 1
 
uint receiveChildEvents: 1
 
uint isWindow: 1
 
uint deleteLaterCalled: 1
 
uint isQuickItem: 1
 
uint willBeWidget: 1
 
uint wasWidget: 1
 
uint unused: 21
 
QAtomicInt postedEvents
 
QDynamicMetaObjectDatametaObject
 
QBindingStorage bindingStorage
 

Additional Inherited Members

- Public Types inherited from QObjectPrivate
typedef void(* StaticMetaCallFunction) (QObject *, QMetaObject::Call, int, void **)
 
using ConnectionDataPointer = QExplicitlySharedDataPointer< ConnectionData >
 

Detailed Description

Definition at line 40 of file qabstractitemmodel_p.h.

Constructor & Destructor Documentation

◆ QAbstractItemModelPrivate()

QAbstractItemModelPrivate::QAbstractItemModelPrivate ( )

Definition at line 700 of file qabstractitemmodel.cpp.

◆ ~QAbstractItemModelPrivate()

QAbstractItemModelPrivate::~QAbstractItemModelPrivate ( )

Definition at line 705 of file qabstractitemmodel.cpp.

Member Function Documentation

◆ allowMove()

bool QAbstractItemModelPrivate::allowMove ( const QModelIndex srcParent,
int  start,
int  end,
const QModelIndex destinationParent,
int  destinationStart,
Qt::Orientation  orientation 
)

Returns whether a move operation is valid.

A move operation is not allowed if it moves a continuous range of rows to a destination within itself, or if it attempts to move a row to one of its own descendants.

Definition at line 2964 of file qabstractitemmodel.cpp.

References QModelIndex::column(), forever, QModelIndex::isValid(), QModelIndex::parent(), pos, QModelIndex::row(), and Qt::Vertical.

+ Here is the call graph for this function:

◆ columnsAboutToBeInserted()

void QAbstractItemModelPrivate::columnsAboutToBeInserted ( const QModelIndex parent,
int  first,
int  last 
)

Definition at line 1043 of file qabstractitemmodel.cpp.

References QList< T >::append(), QAbstractItemModelPrivate::Persistent::indexes, QAbstractItemModelPrivate::Persistent::moved, QObjectData::parent, persistent, QStack< T >::push(), and Q_UNUSED.

+ Here is the call graph for this function:

◆ columnsAboutToBeRemoved()

void QAbstractItemModelPrivate::columnsAboutToBeRemoved ( const QModelIndex parent,
int  first,
int  last 
)

Definition at line 1076 of file qabstractitemmodel.cpp.

References QList< T >::append(), QModelIndex::column(), QAbstractItemModelPrivate::Persistent::indexes, QAbstractItemModelPrivate::Persistent::invalidated, QModelIndex::isValid(), QAbstractItemModelPrivate::Persistent::moved, QModelIndex::parent(), QObjectData::parent, persistent, and QStack< T >::push().

+ Here is the call graph for this function:

◆ columnsInserted()

void QAbstractItemModelPrivate::columnsInserted ( const QModelIndex parent,
int  first,
int  last 
)

◆ columnsRemoved()

void QAbstractItemModelPrivate::columnsRemoved ( const QModelIndex parent,
int  first,
int  last 
)

◆ createIndex() [1/2]

QModelIndex QAbstractItemModelPrivate::createIndex ( int  row,
int  column,
int  id 
) const
inline

Definition at line 73 of file qabstractitemmodel_p.h.

◆ createIndex() [2/2]

QModelIndex QAbstractItemModelPrivate::createIndex ( int  row,
int  column,
void data = nullptr 
) const
inline

Definition at line 69 of file qabstractitemmodel_p.h.

◆ defaultRoleNames()

QByteArray & QAbstractItemModelPrivate::defaultRoleNames ( )
static

Definition at line 746 of file qabstractitemmodel.cpp.

Referenced by QStandardItemModelPrivate::init(), and QAbstractItemModel::roleNames().

+ Here is the caller graph for this function:

◆ executePendingOperations()

void QAbstractItemModelPrivate::executePendingOperations ( ) const
virtual

see QTBUG-94546

Reimplemented in QTreeModelPrivate.

Definition at line 2994 of file qabstractitemmodel.cpp.

Referenced by QItemSelectionModel::hasSelection().

+ Here is the caller graph for this function:

◆ indexValid()

bool QAbstractItemModelPrivate::indexValid ( const QModelIndex index) const
inline

Definition at line 77 of file qabstractitemmodel_p.h.

◆ invalidatePersistentIndex()

void QAbstractItemModelPrivate::invalidatePersistentIndex ( const QModelIndex index)

Clean the QPersistentModelIndex relative to the index if there is one. To be used before an index is invalided

Definition at line 726 of file qabstractitemmodel.cpp.

References QMultiHash< Key, T >::cend(), QMultiHash< Key, T >::constFind(), QMultiHash< Key, T >::erase(), QAbstractItemModelPrivate::Persistent::indexes, it, and persistent.

+ Here is the call graph for this function:

◆ invalidatePersistentIndexes()

void QAbstractItemModelPrivate::invalidatePersistentIndexes ( )

Definition at line 714 of file qabstractitemmodel.cpp.

References QMultiHash< Key, T >::clear(), QAbstractItemModelPrivate::Persistent::indexes, and persistent.

Referenced by QSortFilterProxyModelPrivate::_q_sourceReset().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isVariantLessThan()

bool QAbstractItemModelPrivate::isVariantLessThan ( const QVariant left,
const QVariant right,
Qt::CaseSensitivity  cs = Qt::CaseSensitive,
bool  isLocaleAware = false 
)
static

Definition at line 751 of file qabstractitemmodel.cpp.

References QMetaType::UnknownType.

Referenced by QSortFilterProxyModel::lessThan(), and QStandardItem::operator<().

+ Here is the caller graph for this function:

◆ itemsAboutToBeMoved()

void QAbstractItemModelPrivate::itemsAboutToBeMoved ( const QModelIndex srcParent,
int  srcFirst,
int  srcLast,
const QModelIndex destinationParent,
int  destinationChild,
Qt::Orientation  orientation 
)

Definition at line 891 of file qabstractitemmodel.cpp.

References QList< T >::append(), QAbstractItemModelPrivate::Persistent::indexes, QAbstractItemModelPrivate::Persistent::moved, QObjectData::parent, QObject::parent(), persistent, QStack< T >::push(), and Qt::Vertical.

+ Here is the call graph for this function:

◆ itemsMoved()

void QAbstractItemModelPrivate::itemsMoved ( const QModelIndex srcParent,
int  srcFirst,
int  srcLast,
const QModelIndex destinationParent,
int  destinationChild,
Qt::Orientation  orientation 
)

Definition at line 973 of file qabstractitemmodel.cpp.

References QAbstractItemModelPrivate::Persistent::moved, movePersistentIndexes(), persistent, and QStack< T >::pop().

+ Here is the call graph for this function:

◆ movePersistentIndexes()

void QAbstractItemModelPrivate::movePersistentIndexes ( const QList< QPersistentModelIndexData * > &  indexes,
int  change,
const QModelIndex parent,
Qt::Orientation  orientation 
)

Moves persistent indexes indexes by amount change. The change will be either a change in row value or a change in column value depending on the value of orientation. The indexes may also be moved to a different parent if parent differs from the existing parent for the index.

Definition at line 951 of file qabstractitemmodel.cpp.

References QMultiHash< Key, T >::constFind(), QMultiHash< Key, T >::erase(), QAbstractItemModelPrivate::Persistent::indexes, QAbstractItemModelPrivate::Persistent::insertMultiAtEnd(), QObjectData::parent, persistent, qWarning, and Qt::Vertical.

Referenced by itemsMoved().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ removePersistentIndexData()

void QAbstractItemModelPrivate::removePersistentIndexData ( QPersistentModelIndexData data)

Definition at line 832 of file qabstractitemmodel.cpp.

References QList< T >::at(), i, QAbstractItemModelPrivate::Persistent::indexes, QAbstractItemModelPrivate::Persistent::invalidated, QAbstractItemModelPrivate::Persistent::moved, persistent, Q_ASSERT_X, Q_UNUSED, QMultiHash< Key, T >::remove(), QList< T >::remove(), and QList< T >::size().

+ Here is the call graph for this function:

◆ rowsAboutToBeInserted()

void QAbstractItemModelPrivate::rowsAboutToBeInserted ( const QModelIndex parent,
int  first,
int  last 
)

Definition at line 857 of file qabstractitemmodel.cpp.

References QList< T >::append(), QAbstractItemModelPrivate::Persistent::indexes, QAbstractItemModelPrivate::Persistent::moved, QObjectData::parent, persistent, QStack< T >::push(), and Q_UNUSED.

+ Here is the call graph for this function:

◆ rowsAboutToBeRemoved()

void QAbstractItemModelPrivate::rowsAboutToBeRemoved ( const QModelIndex parent,
int  first,
int  last 
)

Definition at line 991 of file qabstractitemmodel.cpp.

References QList< T >::append(), QAbstractItemModelPrivate::Persistent::indexes, QAbstractItemModelPrivate::Persistent::invalidated, QModelIndex::isValid(), QAbstractItemModelPrivate::Persistent::moved, QModelIndex::parent(), QObjectData::parent, persistent, QStack< T >::push(), and QModelIndex::row().

+ Here is the call graph for this function:

◆ rowsInserted()

void QAbstractItemModelPrivate::rowsInserted ( const QModelIndex parent,
int  first,
int  last 
)

◆ rowsRemoved()

void QAbstractItemModelPrivate::rowsRemoved ( const QModelIndex parent,
int  first,
int  last 
)

◆ staticEmptyModel()

◆ variantLessThan()

bool QAbstractItemModelPrivate::variantLessThan ( const QVariant v1,
const QVariant v2 
)
static

Return {true} if value contains a numerical type.

This function is used by our Q{Tree,Widget,Table}WidgetModel classes to sort.

Definition at line 819 of file qabstractitemmodel.cpp.

References qMax(), and typeOfVariant().

Referenced by QListWidgetItem::operator<(), QTableWidgetItem::operator<(), and QTreeWidgetItem::operator<().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ changes

QStack<Change> QAbstractItemModelPrivate::changes

Definition at line 108 of file qabstractitemmodel_p.h.

◆ persistent


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