aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/types
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@qt.io>2018-07-31 14:39:06 +0200
committerRichard Moe Gustavsen <richard.gustavsen@qt.io>2018-07-31 22:27:47 +0000
commit73fc89bb0dbe9a866e7b1cf47a42a85e5042fead (patch)
tree42d707aa13f16e004ca8ce75884bb1e2d387662b /src/qml/types
parentf294fda40c19c0ecc3c99efb3aabe1b14933cc84 (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/qml/types')
-rw-r--r--src/qml/types/qqmltableinstancemodel.cpp2
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;
}
// --------------------------------------------------------