From 07d302522becc9862c044e3c173e48a3112b6868 Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Wed, 27 Jun 2018 12:54:45 +0200 Subject: QQmlInstanceModel: add virtual function to get abstractItemModel Add a new virtual function to query the model if it's backed by a QAbstractItemModel. This will be needed later when we create another model (QQmlTableInstanceModel) that also inherits QQmlInstanceModel. By having this virtual function, we don't have to check and special case what kind of model is assigned to QQuickTableView, as long as it has a QAIM. Change-Id: I4080fd601ca1988c5fe448d68bdd156740403c60 Reviewed-by: Mitch Curtis --- src/qml/types/qqmldelegatemodel.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/qml/types/qqmldelegatemodel.cpp') diff --git a/src/qml/types/qqmldelegatemodel.cpp b/src/qml/types/qqmldelegatemodel.cpp index f98f57a8ed..76b3b5e76c 100644 --- a/src/qml/types/qqmldelegatemodel.cpp +++ b/src/qml/types/qqmldelegatemodel.cpp @@ -842,6 +842,11 @@ QObject *QQmlDelegateModel::parts() return d->m_parts; } +const QAbstractItemModel *QQmlDelegateModel::abstractItemModel() const +{ + return d_func()->m_adaptorModel.aim(); +} + void QQmlDelegateModelPrivate::emitCreatedPackage(QQDMIncubationTask *incubationTask, QQuickPackage *package) { for (int i = 1; i < m_groupCount; ++i) -- cgit v1.2.3