aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorTim Jenssen <tim.jenssen@qt.io>2018-09-07 15:27:32 +0200
committerTim Jenssen <tim.jenssen@qt.io>2018-09-07 13:32:40 +0000
commit59b49489f00b672e78c0cf76870a68219d35dfac (patch)
tree79ec954fa65af431f26be3bd52cf4593c901e82e /src/plugins
parentb3ccb3998b3d6000a9f3f31a37a16db151b4d265 (diff)
QML Preview: fix a possible crash
Use the preview together with 3d runtime crashes at calling m_currentWindow->framePosition. Change-Id: I582f1bc5e17b24020a95f955752f0ada376289bf Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/qmltooling/qmldbg_preview/qqmlpreviewhandler.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/qmltooling/qmldbg_preview/qqmlpreviewhandler.cpp b/src/plugins/qmltooling/qmldbg_preview/qqmlpreviewhandler.cpp
index 63397be499..21d415bbb6 100644
--- a/src/plugins/qmltooling/qmldbg_preview/qqmlpreviewhandler.cpp
+++ b/src/plugins/qmltooling/qmldbg_preview/qqmlpreviewhandler.cpp
@@ -100,7 +100,7 @@ bool QQmlPreviewHandler::eventFilter(QObject *obj, QEvent *event)
m_lastPosition.initLastSavedWindowPosition(window);
}
}
- if ((event->type() == QEvent::Move || event->type() == QEvent::Resize) &&
+ if (m_currentWindow && (event->type() == QEvent::Move || event->type() == QEvent::Resize) &&
qobject_cast<QQuickWindow*>(obj) == m_currentWindow) {
// we always start with factor 1 so calculate and save the origin as it would be not scaled
m_lastPosition.setPosition(m_currentWindow->framePosition() *