diff options
author | Tim Jenssen <tim.jenssen@qt.io> | 2017-05-15 16:01:34 +0200 |
---|---|---|
committer | Tim Jenssen <tim.jenssen@qt.io> | 2017-05-16 12:06:35 +0000 |
commit | d214db97edcf7a76ecb629d49ac2e9dd0e1948e8 (patch) | |
tree | b13d500cb96cfc4a8b99d95d3634c9825e29f049 /src/quick/designer | |
parent | e6acf80136db9f667d0d4664f6c68065355d6811 (diff) |
Make all loaders synchronous in qquickdesigner support case
It could result in wrong/strange behavior if the QtQuickDesigner
shows asynchronous loaded items in the FormEditor view. So keep
this setting disabled in that case.
Change-Id: I9bbd75f33eb009e31064744564cc4104df624c3c
Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
Diffstat (limited to 'src/quick/designer')
-rw-r--r-- | src/quick/designer/qquickdesignersupportitems.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/quick/designer/qquickdesignersupportitems.cpp b/src/quick/designer/qquickdesignersupportitems.cpp index 2003b484ad..874faed0af 100644 --- a/src/quick/designer/qquickdesignersupportitems.cpp +++ b/src/quick/designer/qquickdesignersupportitems.cpp @@ -47,6 +47,7 @@ #include <private/qquicktextinput_p.h> #include <private/qquicktextedit_p.h> #include <private/qquicktransition_p.h> +#include <private/qquickloader_p.h> #include <private/qquickanimation_p.h> #include <private/qqmlmetatype_p.h> @@ -79,6 +80,12 @@ static void stopAnimation(QObject *object) } } +static void makeLoaderSynchronous(QObject *object) +{ + if (QQuickLoader *loader = qobject_cast<QQuickLoader*>(object)) + loader->setAsynchronous(false); +} + static void allSubObjects(QObject *object, QObjectList &objectList) { // don't add null pointer and stop if the object is already in the list @@ -137,6 +144,7 @@ void QQuickDesignerSupportItems::tweakObjects(QObject *object) allSubObjects(object, objectList); for (QObject* childObject : qAsConst(objectList)) { stopAnimation(childObject); + makeLoaderSynchronous(childObject); if (fixResourcePathsForObjectCallBack) fixResourcePathsForObjectCallBack(childObject); } |