diff options
author | Thomas Hartmann <thomas.hartmann@qt.io> | 2018-03-21 12:47:58 +0100 |
---|---|---|
committer | Thomas Hartmann <thomas.hartmann@qt.io> | 2018-03-26 18:15:27 +0000 |
commit | 8ea6c34606d4afc0b408debd939d5e6d651adf05 (patch) | |
tree | 323499c79af29f38b90f9cb2517d27307f907240 | |
parent | 47f8ec557fed18286a8280b069e18d8b421a9e7b (diff) |
Do not execute a deferred property when component complete is disabled
The Qt Quick Designer disables component complete
and completes the items manually at a later point.
To avoid undefined behavior on items quickBeginDeferred()
should not be called if completion is disabled.
Task-number: QTBUG-67152
Change-Id: Ibf5c6c834436889cfda7862ea7b327731a026cf9
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
-rw-r--r-- | src/quicktemplates2/qquickdeferredexecute_p_p.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/quicktemplates2/qquickdeferredexecute_p_p.h b/src/quicktemplates2/qquickdeferredexecute_p_p.h index 400c5734..29d95ee9 100644 --- a/src/quicktemplates2/qquickdeferredexecute_p_p.h +++ b/src/quicktemplates2/qquickdeferredexecute_p_p.h @@ -51,6 +51,8 @@ #include <QtCore/qglobal.h> #include <QtQuickTemplates2/private/qquickdeferredpointer_p_p.h> +#include <QtQml/private/qqmlvme_p.h> + QT_BEGIN_NAMESPACE class QString; @@ -65,6 +67,9 @@ namespace QtQuickPrivate { template<typename T> void quickBeginDeferred(QObject *object, const QString &property, QQuickDeferredPointer<T> &delegate) { + if (!QQmlVME::componentCompleteEnabled()) + return; + delegate.setExecuting(true); QtQuickPrivate::beginDeferred(object, property); delegate.setExecuting(false); |