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 <qitemselectionmodel_p.h>
Additional Inherited Members | |
Public Types inherited from QObjectPrivate | |
typedef void(* | StaticMetaCallFunction) (QObject *, QMetaObject::Call, int, void **) |
using | ConnectionDataPointer = QExplicitlySharedDataPointer<ConnectionData> |
Static Public Member Functions inherited from QObjectPrivate | |
static bool | removeConnection (Connection *c) |
static QObjectPrivate * | get (QObject *o) |
static const QObjectPrivate * | get (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) |
Definition at line 27 of file qitemselectionmodel_p.h.
|
inline |
Definition at line 31 of file qitemselectionmodel_p.h.
void QItemSelectionModelPrivate::columnsAboutToBeInserted | ( | const QModelIndex & | parent, |
int | start, | ||
int | end ) |
Split selection ranges if columns are about to be inserted in the middle.
Definition at line 766 of file qitemselectionmodel.cpp.
References QSet< T >::begin(), QSet< T >::end(), QSet< T >::erase(), finalize(), QAbstractTableModel::index(), it, model, QObjectData::parent, Q_UNUSED, and split().
Referenced by initModel().
void QItemSelectionModelPrivate::columnsAboutToBeRemoved | ( | const QModelIndex & | parent, |
int | start, | ||
int | end ) |
Definition at line 729 of file qitemselectionmodel.cpp.
References QPersistentModelIndex::column(), currentIndex, QItemSelectionModel::Deselect, emit, finalize(), QAbstractTableModel::index(), QPersistentModelIndex::isValid(), model, QPersistentModelIndex::parent(), QObjectData::parent, QPersistentModelIndex::row(), QModelIndex::row(), and QSqlQueryModel::rowCount().
Referenced by initModel().
void QItemSelectionModelPrivate::disconnectModel | ( | ) |
Definition at line 598 of file qitemselectionmodel.cpp.
References connection, connections, and QObject::disconnect().
Referenced by initModel(), and modelDestroyed().
QItemSelection QItemSelectionModelPrivate::expandSelection | ( | const QItemSelection & | selection, |
QItemSelectionModel::SelectionFlags | command ) const |
returns a QItemSelection where all ranges have been expanded to: Rows: left: 0 and right: columnCount()-1 Columns: top: 0 and bottom: rowCount()-1
Definition at line 612 of file qitemselectionmodel.cpp.
References QList< T >::at(), QItemSelectionRange::bottom(), QSqlQueryModel::columnCount(), QItemSelectionModel::Columns, i, QAbstractTableModel::index(), QList< T >::isEmpty(), QItemSelectionRange::left(), QItemSelection::merge(), model, QItemSelectionRange::parent(), QObjectData::parent, QItemSelectionRange::right(), QSqlQueryModel::rowCount(), QItemSelectionModel::Rows, QItemSelectionModel::Select, selection, QList< T >::size(), and QItemSelectionRange::top().
|
inline |
Definition at line 65 of file qitemselectionmodel_p.h.
References QList< T >::clear(), currentCommand, currentSelection, and QList< T >::isEmpty().
Referenced by columnsAboutToBeInserted(), columnsAboutToBeRemoved(), rowsAboutToBeInserted(), and rowsAboutToBeRemoved().
void QItemSelectionModelPrivate::initModel | ( | QAbstractItemModel * | model | ) |
Definition at line 553 of file qitemselectionmodel.cpp.
References QAbstractItemModel::columnsAboutToBeInserted(), columnsAboutToBeInserted(), QAbstractItemModel::columnsAboutToBeMoved(), QAbstractItemModel::columnsAboutToBeRemoved(), columnsAboutToBeRemoved(), QAbstractItemModel::columnsMoved(), QObject::connect(), QObjectPrivate::connect(), connections, QObject::destroyed(), disconnectModel(), layoutAboutToBeChanged(), QAbstractItemModel::layoutAboutToBeChanged(), layoutChanged(), QAbstractItemModel::layoutChanged(), model, modelDestroyed(), QAbstractItemModel::modelReset(), QItemSelectionModel::reset(), QAbstractItemModel::rowsAboutToBeInserted(), rowsAboutToBeInserted(), QAbstractItemModel::rowsAboutToBeMoved(), QAbstractItemModel::rowsAboutToBeRemoved(), rowsAboutToBeRemoved(), QAbstractItemModel::rowsMoved(), triggerLayoutChanged(), and triggerLayoutToBeChanged().
Referenced by QItemSelectionModel::QItemSelectionModel().
void QItemSelectionModelPrivate::layoutAboutToBeChanged | ( | const QList< QPersistentModelIndex > & | parents, |
QAbstractItemModel::LayoutChangeHint | hint ) |
Split selection into individual (persistent) indexes. This is done in preparation for the layoutChanged() signal, where the indexes can be merged again.
Definition at line 837 of file qitemselectionmodel.cpp.
References QList< T >::clear(), QSqlQueryModel::columnCount(), QList< T >::constFirst(), currentSelection, hint(), model, QObjectData::parent, QObject::parent(), qSelectionPersistentRowLengths(), QSqlQueryModel::rowCount(), savedPersistentCurrentIndexes, savedPersistentCurrentRowLengths, savedPersistentIndexes, savedPersistentRowLengths, QList< T >::size(), tableColCount, tableParent, tableRowCount, tableSelected, and QAbstractItemModel::VerticalSortHint.
Referenced by initModel(), and triggerLayoutToBeChanged().
void QItemSelectionModelPrivate::layoutChanged | ( | const QList< QPersistentModelIndex > & | parents, |
QAbstractItemModel::LayoutChangeHint | hint ) |
Merge the selected indexes into selection ranges again.
Definition at line 1003 of file qitemselectionmodel.cpp.
References QList< T >::begin(), QList< T >::clear(), QSqlQueryModel::columnCount(), currentSelection, QList< T >::end(), hint(), QAbstractTableModel::index(), QList< T >::isEmpty(), mergeIndexes(), mergeRowLengths(), model, qt_PersistentModelIndexLessThan(), QSqlQueryModel::rowCount(), savedPersistentCurrentIndexes, savedPersistentCurrentRowLengths, savedPersistentIndexes, savedPersistentRowLengths, tableColCount, tableParent, tableRowCount, tableSelected, and QAbstractItemModel::VerticalSortHint.
Referenced by initModel(), and triggerLayoutChanged().
|
inline |
Definition at line 74 of file qitemselectionmodel_p.h.
References emit.
void QItemSelectionModelPrivate::modelDestroyed | ( | ) |
Called when the used model gets destroyed.
It is impossible to have a correct implementation here. In the following situation, there are two contradicting rules:
What should returnedModel be in this situation?
Rules for bindable properties say that myItemSelectionModel.model() should return the same as leader.value(), namely the pointer to the now deleted model.
However, backward compatibility requires myItemSelectionModel.model() to return a nullptr, because that was done in the past after the model used was deleted.
We decide to break the new rule, imposed by bindable properties, and not break the old rule, because that may break existing code.
Definition at line 1087 of file qitemselectionmodel.cpp.
References disconnectModel(), and model.
Referenced by initModel().
QItemSelectionModelPrivate::Q_OBJECT_COMPAT_PROPERTY_WITH_ARGS | ( | QItemSelectionModelPrivate | , |
QAbstractItemModel * | , | ||
model | , | ||
&QItemSelectionModelPrivate::setModel | , | ||
&QItemSelectionModelPrivate::modelChanged | , | ||
nullptr | ) |
|
inline |
Definition at line 58 of file qitemselectionmodel_p.h.
References QSet< T >::constBegin(), QSet< T >::constEnd(), and it.
void QItemSelectionModelPrivate::rowsAboutToBeInserted | ( | const QModelIndex & | parent, |
int | start, | ||
int | end ) |
Split selection ranges if rows are about to be inserted in the middle.
Definition at line 796 of file qitemselectionmodel.cpp.
References QSet< T >::begin(), emit, QSet< T >::end(), QSet< T >::erase(), finalize(), QAbstractTableModel::index(), it, model, QObjectData::parent, Q_UNUSED, and split().
Referenced by initModel().
void QItemSelectionModelPrivate::rowsAboutToBeRemoved | ( | const QModelIndex & | parent, |
int | start, | ||
int | end ) |
Definition at line 646 of file qitemselectionmodel.cpp.
References QSet< T >::begin(), QPersistentModelIndex::column(), QModelIndex::column(), currentIndex, emit, QSet< T >::end(), QSet< T >::erase(), finalize(), QAbstractTableModel::index(), QPersistentModelIndex::isValid(), it, model, QPersistentModelIndex::parent(), QObjectData::parent, Q_ASSERT, QPersistentModelIndex::row(), and QItemSelection::split().
Referenced by initModel().
|
inline |
Definition at line 72 of file qitemselectionmodel_p.h.
|
inline |
Definition at line 51 of file qitemselectionmodel_p.h.
References layoutChanged(), and QAbstractItemModel::NoLayoutChangeHint.
Referenced by initModel().
|
inline |
Definition at line 45 of file qitemselectionmodel_p.h.
References layoutAboutToBeChanged(), and QAbstractItemModel::NoLayoutChangeHint.
Referenced by initModel().
std::array<QMetaObject::Connection, 12> QItemSelectionModelPrivate::connections |
Definition at line 91 of file qitemselectionmodel_p.h.
Referenced by disconnectModel(), and initModel().
QItemSelectionModel::SelectionFlags QItemSelectionModelPrivate::currentCommand |
Definition at line 82 of file qitemselectionmodel_p.h.
Referenced by finalize().
QPersistentModelIndex QItemSelectionModelPrivate::currentIndex |
Definition at line 81 of file qitemselectionmodel_p.h.
Referenced by columnsAboutToBeRemoved(), and rowsAboutToBeRemoved().
QItemSelection QItemSelectionModelPrivate::currentSelection |
Definition at line 80 of file qitemselectionmodel_p.h.
Referenced by finalize(), layoutAboutToBeChanged(), and layoutChanged().
QList<QPersistentModelIndex> QItemSelectionModelPrivate::savedPersistentCurrentIndexes |
Definition at line 84 of file qitemselectionmodel_p.h.
Referenced by layoutAboutToBeChanged(), and layoutChanged().
QList<std::pair<QPersistentModelIndex, uint> > QItemSelectionModelPrivate::savedPersistentCurrentRowLengths |
Definition at line 86 of file qitemselectionmodel_p.h.
Referenced by layoutAboutToBeChanged(), and layoutChanged().
QList<QPersistentModelIndex> QItemSelectionModelPrivate::savedPersistentIndexes |
Definition at line 83 of file qitemselectionmodel_p.h.
Referenced by layoutAboutToBeChanged(), and layoutChanged().
QList<std::pair<QPersistentModelIndex, uint> > QItemSelectionModelPrivate::savedPersistentRowLengths |
Definition at line 85 of file qitemselectionmodel_p.h.
Referenced by layoutAboutToBeChanged(), and layoutChanged().
int QItemSelectionModelPrivate::tableColCount |
Definition at line 90 of file qitemselectionmodel_p.h.
Referenced by layoutAboutToBeChanged(), and layoutChanged().
QPersistentModelIndex QItemSelectionModelPrivate::tableParent |
Definition at line 89 of file qitemselectionmodel_p.h.
Referenced by layoutAboutToBeChanged(), and layoutChanged().
int QItemSelectionModelPrivate::tableRowCount |
Definition at line 90 of file qitemselectionmodel_p.h.
Referenced by layoutAboutToBeChanged(), and layoutChanged().
bool QItemSelectionModelPrivate::tableSelected |
Definition at line 88 of file qitemselectionmodel_p.h.
Referenced by layoutAboutToBeChanged(), and layoutChanged().