aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/types/qqmlobjectmodel_p.h
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@qt.io>2018-06-27 12:54:45 +0200
committerRichard Moe Gustavsen <richard.gustavsen@qt.io>2018-06-27 12:17:13 +0000
commit07d302522becc9862c044e3c173e48a3112b6868 (patch)
tree77375c47c81e4f557c1c4ccc5410660baeae1185 /src/qml/types/qqmlobjectmodel_p.h
parenteb98186670db90c7420b46e1442ad67b076d9af3 (diff)
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 <mitch.curtis@qt.io>
Diffstat (limited to 'src/qml/types/qqmlobjectmodel_p.h')
-rw-r--r--src/qml/types/qqmlobjectmodel_p.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/qml/types/qqmlobjectmodel_p.h b/src/qml/types/qqmlobjectmodel_p.h
index 267828dcdd..4ac4f1c65b 100644
--- a/src/qml/types/qqmlobjectmodel_p.h
+++ b/src/qml/types/qqmlobjectmodel_p.h
@@ -60,6 +60,7 @@ QT_BEGIN_NAMESPACE
class QObject;
class QQmlChangeSet;
+class QAbstractItemModel;
class Q_QML_PRIVATE_EXPORT QQmlInstanceModel : public QObject
{
@@ -83,6 +84,7 @@ public:
virtual QQmlIncubator::Status incubationStatus(int index) = 0;
virtual int indexOf(QObject *object, QObject *objectContext) const = 0;
+ virtual const QAbstractItemModel *abstractItemModel() const { return nullptr; }
Q_SIGNALS:
void countChanged();