6#include <private/qabstractproxymodel_p.h>
8#include <QtCore/QStringList>
52void QAbstractProxyModelPrivate::_q_sourceModelDestroyed()
78 const int columnCount =
q->columnCount();
91 const int columnCount =
q->columnCount();
110 const int rowCount =
q->rowCount();
122 const int rowCount =
q->rowCount();
166 d->model.removeBindingUnlessInWrapper();
171 static const struct {
172 const char *signalName;
173 const char *slotName;
174 } connectionTable[] = {
188 for (
const auto &
c : connectionTable)
194 for (
const auto &
c : connectionTable)
195 connect(
d->model,
c.signalName,
this,
c.slotName);
226 return d->model->submit();
266 for (
int i = 0;
i < proxyIndexes.
size(); ++
i) {
272 return sourceSelection;
284 for (
int i = 0;
i < sourceIndexes.
size(); ++
i) {
290 return proxySelection;
308 int sourceSection = section;
320 return d->model->headerData(sourceSection, orientation, role);
373 return d->model->setHeaderData(sourceSection, orientation,
value, role);
458 return d->model->mimeData(
list);
462 int *sourceRow,
int *sourceColumn,
QModelIndex *sourceParent)
const
468 *sourceParent =
q->mapToSource(
parent);
470 *sourceParent =
q->mapToSource(
parent);
475 *sourceRow = sourceIndex.
row();
476 *sourceColumn = sourceIndex.
column();
477 *sourceParent = sourceIndex.
parent();
489 int sourceDestinationRow;
490 int sourceDestinationColumn;
492 d->mapDropCoordinatesToSource(
row,
column,
parent, &sourceDestinationRow, &sourceDestinationColumn, &sourceParent);
493 return d->model->canDropMimeData(
data, action, sourceDestinationRow, sourceDestinationColumn, sourceParent);
504 int sourceDestinationRow;
505 int sourceDestinationColumn;
507 d->mapDropCoordinatesToSource(
row,
column,
parent, &sourceDestinationRow, &sourceDestinationColumn, &sourceParent);
508 return d->model->dropMimeData(
data, action, sourceDestinationRow, sourceDestinationColumn, sourceParent);
517 return d->model->mimeTypes();
526 return d->model->supportedDragActions();
535 return d->model->supportedDropActions();
544 return d->model->roleNames();
570#include "moc_qabstractproxymodel.cpp"
void invalidatePersistentIndexes()
static QAbstractItemModel * staticEmptyModel()
Q_INVOKABLE int const QModelIndex & parent
Returns the parent of the model item with the given index.
void columnsRemoved(const QModelIndex &parent, int first, int last, QPrivateSignal)
This signal is emitted after columns have been removed from the model.
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.
virtual Q_INVOKABLE int rowCount(const QModelIndex &parent=QModelIndex()) const =0
Returns the number of rows under the given parent.
void headerDataChanged(Qt::Orientation orientation, int first, int last)
This signal is emitted whenever a header is changed.
virtual Q_INVOKABLE int columnCount(const QModelIndex &parent=QModelIndex()) const =0
Returns the number of columns for the children of the given parent.
void rowsInserted(const QModelIndex &parent, int first, int last, QPrivateSignal)
This signal is emitted after rows have been inserted into the model.
friend class QAbstractProxyModel
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.
void _q_sourceModelColumnsAboutToBeInserted(const QModelIndex &parent, int first, int last)
void _q_sourceModelColumnsRemoved(const QModelIndex &parent, int first, int last)
void _q_sourceModelRowsAboutToBeInserted(const QModelIndex &parent, int first, int last)
void mapDropCoordinatesToSource(int row, int column, const QModelIndex &parent, int *source_row, int *source_column, QModelIndex *source_parent) const
void _q_sourceModelRowsRemoved(const QModelIndex &parent, int first, int last)
unsigned int sourceHadZeroColumns
unsigned int sourceHadZeroRows
void _q_sourceModelColumnsInserted(const QModelIndex &parent, int first, int last)
void _q_sourceModelRowsInserted(const QModelIndex &parent, int first, int last)
The QAbstractProxyModel class provides a base class for proxy item models that can do sorting,...
QModelIndex buddy(const QModelIndex &index) const override
\reimp
void fetchMore(const QModelIndex &parent) override
\reimp
Qt::DropActions supportedDragActions() const override
\reimp
~QAbstractProxyModel()
Destroys the proxy model.
QSize span(const QModelIndex &index) const override
\reimp
QVariant data(const QModelIndex &proxyIndex, int role=Qt::DisplayRole) const override
\reimp
QModelIndex sibling(int row, int column, const QModelIndex &idx) const override
\reimp
QHash< int, QByteArray > roleNames() const override
\reimp
bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) override
\reimp
virtual Q_INVOKABLE QItemSelection mapSelectionFromSource(const QItemSelection &selection) const
Returns a proxy selection mapped from the specified sourceSelection.
virtual Q_INVOKABLE QModelIndex mapToSource(const QModelIndex &proxyIndex) const =0
Reimplement this function to return the model index in the source model that corresponds to the proxy...
Qt::ItemFlags flags(const QModelIndex &index) const override
\reimp
virtual Q_INVOKABLE QModelIndex mapFromSource(const QModelIndex &sourceIndex) const =0
Reimplement this function to return the model index in the proxy model that corresponds to the source...
QModelIndex createSourceIndex(int row, int col, void *internalPtr) const
Equivalent to calling createIndex on the source model.
bool setItemData(const QModelIndex &index, const QMap< int, QVariant > &roles) override
\reimp
bool hasChildren(const QModelIndex &parent=QModelIndex()) const override
\reimp
bool canFetchMore(const QModelIndex &parent) const override
\reimp
QAbstractItemModel * sourceModel
the source model of this proxy model.
bool clearItemData(const QModelIndex &index) override
\reimp
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
\reimp
QMimeData * mimeData(const QModelIndexList &indexes) const override
\reimp
QMap< int, QVariant > itemData(const QModelIndex &index) const override
\reimp
void sort(int column, Qt::SortOrder order=Qt::AscendingOrder) override
\reimp
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
\reimp
bool canDropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) const override
\reimp
void revert() override
\reimp
bool setHeaderData(int section, Qt::Orientation orientation, const QVariant &value, int role=Qt::EditRole) override
\reimp
virtual Q_INVOKABLE QItemSelection mapSelectionToSource(const QItemSelection &selection) const
Returns a source selection mapped from the specified proxySelection.
Qt::DropActions supportedDropActions() const override
\reimp
virtual void setSourceModel(QAbstractItemModel *sourceModel)
Sets the given sourceModel to be processed by the proxy model.
QBindable< QAbstractItemModel * > bindableSourceModel()
QStringList mimeTypes() const override
\reimp
bool submit() override
\reimp
Q_CORE_EXPORT QModelIndexList indexes() const
Returns a list of model indexes that correspond to the selected items.
qsizetype size() const noexcept
const_reference at(qsizetype i) const noexcept
void reserve(qsizetype size)
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 int column() const noexcept
Returns the column this model index refers to.
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
void destroyed(QObject *=nullptr)
This signal is emitted immediately before the object obj is destroyed, after any instances of QPointe...
int rowCount(const QModelIndex &parent=QModelIndex()) const override
int columnCount(const QModelIndex &parent=QModelIndex()) const override
\reimp
Combined button and popup list for selecting options.
static auto emitHeaderDataChanged(QAbstractItemModel *model, Qt::Orientation orientation, int count)
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
GLfixed GLfixed GLint GLint order
QSqlQueryModel * model
[16]
myObject disconnect()
[26]
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent