diff options
author | Richard Moe Gustavsen <richard.gustavsen@qt.io> | 2018-07-31 14:39:06 +0200 |
---|---|---|
committer | Richard Moe Gustavsen <richard.gustavsen@qt.io> | 2018-07-31 22:27:47 +0000 |
commit | 73fc89bb0dbe9a866e7b1cf47a42a85e5042fead (patch) | |
tree | 42d707aa13f16e004ca8ce75884bb1e2d387662b /src | |
parent | f294fda40c19c0ecc3c99efb3aabe1b14933cc84 (diff) |
QQmlTableInstanceModel: check if adaptormodel adapts AIM before using it
The aim() function doesn't check if the model inside QQmlAdaptorModel
is a actually a QAbstractItemModel (it just does a static cast).
So we need to guard it.
This is essentially the same fix as was done for
QQmlDelegateModel (sha1: 9757d5f9c90988).
Change-Id: I9f14e1639b5e7df4190333c679e805e7f9f7481a
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/qml/types/qqmltableinstancemodel.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qml/types/qqmltableinstancemodel.cpp b/src/qml/types/qqmltableinstancemodel.cpp index dcad84cfb8..bab70ecaa6 100644 --- a/src/qml/types/qqmltableinstancemodel.cpp +++ b/src/qml/types/qqmltableinstancemodel.cpp @@ -314,7 +314,7 @@ void QQmlTableInstanceModel::setDelegate(QQmlComponent *delegate) const QAbstractItemModel *QQmlTableInstanceModel::abstractItemModel() const { - return m_adaptorModel.aim(); + return m_adaptorModel.adaptsAim() ? m_adaptorModel.aim() : nullptr; } // -------------------------------------------------------- |