diff --git a/src/corelib/itemmodels/qconcatenatetablesproxymodel.cpp b/src/corelib/itemmodels/qconcatenatetablesproxymodel.cpp index 3afa132483..a2597faa93 100644 --- a/src/corelib/itemmodels/qconcatenatetablesproxymodel.cpp +++ b/src/corelib/itemmodels/qconcatenatetablesproxymodel.cpp @@ -447,6 +447,17 @@ QSize QConcatenateTablesProxyModel::span(const QModelIndex &index) const return sourceIndex.model()->span(sourceIndex); } +/*! + Returns a list of models that were added as source models for this proxy model. + + \since 5.15 +*/ +QList QConcatenateTablesProxyModel::sourceModels() const +{ + Q_D(const QConcatenateTablesProxyModel); + return d->m_models.toList(); +} + /*! Adds a source model \a sourceModel, below all previously added source models. diff --git a/src/corelib/itemmodels/qconcatenatetablesproxymodel.h b/src/corelib/itemmodels/qconcatenatetablesproxymodel.h index 69b3a2ba09..1fa84d5f51 100644 --- a/src/corelib/itemmodels/qconcatenatetablesproxymodel.h +++ b/src/corelib/itemmodels/qconcatenatetablesproxymodel.h @@ -56,6 +56,7 @@ public: explicit QConcatenateTablesProxyModel(QObject *parent = nullptr); ~QConcatenateTablesProxyModel(); + QList sourceModels() const; Q_SCRIPTABLE void addSourceModel(QAbstractItemModel *sourceModel); Q_SCRIPTABLE void removeSourceModel(QAbstractItemModel *sourceModel);