QConcatenateTablesProxyModel: Add getter for sourceModels
Currently, there's no generic way to get the source models as there's only calls to add or remove them. Change-Id: I23cdef7c93328b58a80ec4659b44073f8ff05088 Reviewed-by: David Faure <david.faure@kdab.com>
This commit is contained in:
parent
ede8545245
commit
c2a13ae501
@ -447,6 +447,17 @@ QSize QConcatenateTablesProxyModel::span(const QModelIndex &index) const
|
|||||||
return sourceIndex.model()->span(sourceIndex);
|
return sourceIndex.model()->span(sourceIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Returns a list of models that were added as source models for this proxy model.
|
||||||
|
|
||||||
|
\since 5.15
|
||||||
|
*/
|
||||||
|
QList<QAbstractItemModel *> QConcatenateTablesProxyModel::sourceModels() const
|
||||||
|
{
|
||||||
|
Q_D(const QConcatenateTablesProxyModel);
|
||||||
|
return d->m_models.toList();
|
||||||
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Adds a source model \a sourceModel, below all previously added source models.
|
Adds a source model \a sourceModel, below all previously added source models.
|
||||||
|
|
||||||
|
@ -56,6 +56,7 @@ public:
|
|||||||
explicit QConcatenateTablesProxyModel(QObject *parent = nullptr);
|
explicit QConcatenateTablesProxyModel(QObject *parent = nullptr);
|
||||||
~QConcatenateTablesProxyModel();
|
~QConcatenateTablesProxyModel();
|
||||||
|
|
||||||
|
QList<QAbstractItemModel *> sourceModels() const;
|
||||||
Q_SCRIPTABLE void addSourceModel(QAbstractItemModel *sourceModel);
|
Q_SCRIPTABLE void addSourceModel(QAbstractItemModel *sourceModel);
|
||||||
Q_SCRIPTABLE void removeSourceModel(QAbstractItemModel *sourceModel);
|
Q_SCRIPTABLE void removeSourceModel(QAbstractItemModel *sourceModel);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user