7#include <private/qabstractproxymodel_p.h>
127 if (!
d->model || !sourceIndex.
isValid())
143 return proxySelection;
154 return proxySelection;
166 return sourceSelection;
177 return sourceSelection;
186 if (!
d->model || !proxyIndex.
isValid())
203 QModelIndexList::const_iterator
it = sourceList.
constBegin();
204 const QModelIndexList::const_iterator
end = sourceList.
constEnd();
283 return d->model->headerData(section, orientation, role);
319 this,
SLOT(_q_sourceModelAboutToBeReset()));
321 this,
SLOT(_q_sourceModelReset()));
360 SLOT(_q_sourceModelAboutToBeReset()));
362 SLOT(_q_sourceModelReset()));
388 q->beginMoveColumns(
q->mapFromSource(sourceParent), sourceStart, sourceEnd,
q->mapFromSource(destParent), dest);
405 q->endInsertColumns();
428 q->endRemoveColumns();
436 emit q->dataChanged(
q->mapFromSource(topLeft),
q->mapFromSource(bottomRight), roles);
442 emit q->headerDataChanged(orientation,
first, last);
458 parents << mappedParent;
461 emit q->layoutAboutToBeChanged(parents,
hint);
463 const auto proxyPersistentIndexes =
q->persistentIndexList();
464 for (
const QModelIndex &proxyPersistentIndex : proxyPersistentIndexes) {
466 Q_ASSERT(proxyPersistentIndex.isValid());
493 parents << mappedParent;
502 q->beginResetModel();
523 q->beginMoveRows(
q->mapFromSource(sourceParent), sourceStart, sourceEnd,
q->mapFromSource(destParent), dest);
568#include "moc_qidentityproxymodel.cpp"
void rowsMoved(const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destinationParent, int destinationRow, QPrivateSignal)
void endResetModel()
Completes a model reset operation.
void modelAboutToBeReset(QPrivateSignal)
void columnsRemoved(const QModelIndex &parent, int first, int last, QPrivateSignal)
This signal is emitted after columns have been removed from the model.
LayoutChangeHint
This enum describes the way the model changes layout.
void rowsAboutToBeInserted(const QModelIndex &parent, int first, int last, QPrivateSignal)
This signal is emitted just before rows are inserted into the model.
void columnsAboutToBeInserted(const QModelIndex &parent, int first, int last, QPrivateSignal)
This signal is emitted just before columns are inserted into the model.
void modelReset(QPrivateSignal)
Q_INVOKABLE int int const QModelIndex & destinationParent
void layoutAboutToBeChanged(const QList< QPersistentModelIndex > &parents=QList< QPersistentModelIndex >(), QAbstractItemModel::LayoutChangeHint hint=QAbstractItemModel::NoLayoutChangeHint)
void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QList< int > &roles=QList< int >())
This signal is emitted whenever the data in an existing item changes.
void columnsAboutToBeMoved(const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destinationParent, int destinationColumn, QPrivateSignal)
void columnsAboutToBeRemoved(const QModelIndex &parent, int first, int last, QPrivateSignal)
This signal is emitted just before columns are removed from the model.
Q_INVOKABLE int int const QModelIndex int destinationChild
void layoutChanged(const QList< QPersistentModelIndex > &parents=QList< QPersistentModelIndex >(), QAbstractItemModel::LayoutChangeHint hint=QAbstractItemModel::NoLayoutChangeHint)
Q_INVOKABLE int sourceRow
void headerDataChanged(Qt::Orientation orientation, int first, int last)
This signal is emitted whenever a header is changed.
void rowsAboutToBeRemoved(const QModelIndex &parent, int first, int last, QPrivateSignal)
This signal is emitted just before rows are removed from the model.
void beginResetModel()
Begins a model reset operation.
void rowsAboutToBeMoved(const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destinationParent, int destinationRow, QPrivateSignal)
void rowsInserted(const QModelIndex &parent, int first, int last, QPrivateSignal)
This signal is emitted after rows have been inserted into the model.
Q_INVOKABLE int sourceColumn
void columnsMoved(const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destinationParent, int destinationColumn, QPrivateSignal)
QModelIndex createIndex(int row, int column, const void *data=nullptr) const
Creates a model index for the given row and column with the internal pointer ptr.
void columnsInserted(const QModelIndex &parent, int first, int last, QPrivateSignal)
This signal is emitted after columns have been inserted into the model.
void rowsRemoved(const QModelIndex &parent, int first, int last, QPrivateSignal)
This signal is emitted after rows have been removed from the model.
The QAbstractProxyModel class provides a base class for proxy item models that can do sorting,...
QModelIndex createSourceIndex(int row, int col, void *internalPtr) const
Equivalent to calling createIndex on the source model.
QAbstractItemModel * sourceModel
the source model of this proxy model.
virtual void setSourceModel(QAbstractItemModel *sourceModel)
Sets the given sourceModel to be processed by the proxy model.
void _q_sourceRowsAboutToBeRemoved(const QModelIndex &parent, int start, int end)
QList< QPersistentModelIndex > layoutChangePersistentIndexes
QModelIndexList proxyIndexes
void _q_sourceColumnsRemoved(const QModelIndex &parent, int start, int end)
void _q_sourceModelAboutToBeReset()
void _q_sourceColumnsAboutToBeInserted(const QModelIndex &parent, int start, int end)
void _q_sourceRowsAboutToBeInserted(const QModelIndex &parent, int start, int end)
void _q_sourceColumnsMoved(const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destParent, int dest)
void _q_sourceColumnsInserted(const QModelIndex &parent, int start, int end)
void _q_sourceRowsMoved(const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destParent, int dest)
void _q_sourceLayoutAboutToBeChanged(const QList< QPersistentModelIndex > &sourceParents, QAbstractItemModel::LayoutChangeHint hint)
void _q_sourceHeaderDataChanged(Qt::Orientation orientation, int first, int last)
void _q_sourceColumnsAboutToBeRemoved(const QModelIndex &parent, int start, int end)
void _q_sourceRowsAboutToBeMoved(const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destParent, int dest)
void _q_sourceRowsRemoved(const QModelIndex &parent, int start, int end)
void _q_sourceRowsInserted(const QModelIndex &parent, int start, int end)
void _q_sourceLayoutChanged(const QList< QPersistentModelIndex > &sourceParents, QAbstractItemModel::LayoutChangeHint hint)
void _q_sourceColumnsAboutToBeMoved(const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destParent, int dest)
void _q_sourceDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QList< int > &roles)
void _q_sourceModelReset()
The QIdentityProxyModel class proxies its source model unmodified.
int columnCount(const QModelIndex &parent=QModelIndex()) const override
\reimp
bool moveRows(const QModelIndex &sourceParent, int sourceRow, int count, const QModelIndex &destinationParent, int destinationChild) override
\reimp
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
\reimp
void setSourceModel(QAbstractItemModel *sourceModel) override
\reimp
bool moveColumns(const QModelIndex &sourceParent, int sourceColumn, int count, const QModelIndex &destinationParent, int destinationChild) override
\reimp
QItemSelection mapSelectionFromSource(const QItemSelection &selection) const override
\reimp
QItemSelection mapSelectionToSource(const QItemSelection &selection) const override
\reimp
bool insertColumns(int column, int count, const QModelIndex &parent=QModelIndex()) override
\reimp
bool removeColumns(int column, int count, const QModelIndex &parent=QModelIndex()) override
\reimp
QObject * parent() const
Returns a pointer to the parent object.
QModelIndex sibling(int row, int column, const QModelIndex &idx) const override
\reimp
int rowCount(const QModelIndex &parent=QModelIndex()) const override
\reimp
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const override
\reimp
bool insertRows(int row, int count, const QModelIndex &parent=QModelIndex()) override
\reimp
QModelIndex mapFromSource(const QModelIndex &sourceIndex) const override
\reimp
QModelIndexList match(const QModelIndex &start, int role, const QVariant &value, int hits=1, Qt::MatchFlags flags=Qt::MatchFlags(Qt::MatchStartsWith|Qt::MatchWrap)) const override
\reimp
QIdentityProxyModel(QObject *parent=nullptr)
Constructs an identity model with the given parent.
QModelIndex mapToSource(const QModelIndex &proxyIndex) const override
\reimp
bool removeRows(int row, int count, const QModelIndex &parent=QModelIndex()) override
\reimp
bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) override
\reimp
~QIdentityProxyModel()
Destroys this identity model.
qsizetype size() const noexcept
const_reference at(qsizetype i) const noexcept
const_iterator constBegin() const noexcept
void reserve(qsizetype size)
void append(parameter_type t)
const_iterator constEnd() const noexcept
constexpr int row() const noexcept
Returns the row this model index refers to.
QModelIndex parent() const
Returns the parent of the model index, or QModelIndex() if it has no parent.
constexpr const QAbstractItemModel * model() const noexcept
Returns a pointer to the model containing the item that this index refers to.
constexpr int column() const noexcept
Returns the column this model index refers to.
void * internalPointer() const noexcept
Returns a {void} {*} pointer used by the model to associate the index with the internal data structur...
constexpr bool isValid() const noexcept
Returns {true} if this model index is valid; otherwise returns {false}.
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
bool isValid() const
Returns {true} if this persistent model index is valid; otherwise returns {false}.
QSet< QString >::iterator it
Combined button and popup list for selecting options.
QList< QModelIndex > QModelIndexList
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
GLenum GLenum GLsizei count
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum GLenum GLsizei void GLsizei void * column
GLdouble GLdouble GLdouble GLdouble q
GLenum GLenum GLsizei void * row
static QT_BEGIN_NAMESPACE QVariant hint(QPlatformIntegration::StyleHint h)
QSqlQueryModel * model
[16]
myObject disconnect()
[26]
QItemSelection * selection
[0]
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent