diff options
author | Thomas Hartmann <Thomas.Hartmann@digia.com> | 2013-04-09 12:54:09 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-04-11 08:50:58 +0200 |
commit | 1a1ce4326c55f0af9acb3d3b42d70040bbe45673 (patch) | |
tree | 27f3282bad67967be381850bb4ae54fdef643169 /src/qml | |
parent | cbd82ea95ea70b4561c1b019e78a9bc4aaf1e5ee (diff) |
DesignerSupport: Adding separate flag for component completion
The designer should only disable completion of components
if the component is created directly by the designer.
Change-Id: Id86d2b2f2e61355240bdbbb7875db3e97fb0da17
Reviewed-by: Marco Bubke <marco.bubke@digia.com>
Diffstat (limited to 'src/qml')
-rw-r--r-- | src/qml/qml/qqmlvme.cpp | 19 | ||||
-rw-r--r-- | src/qml/qml/qqmlvme_p.h | 6 |
2 files changed, 24 insertions, 1 deletions
diff --git a/src/qml/qml/qqmlvme.cpp b/src/qml/qml/qqmlvme.cpp index 8198eeca66..c34b922ab7 100644 --- a/src/qml/qml/qqmlvme.cpp +++ b/src/qml/qml/qqmlvme.cpp @@ -91,6 +91,8 @@ using namespace QQmlVMETypes; goto exceptionExit; \ } +bool QQmlVME::s_enableComponentComplete = true; + void QQmlVME::init(QQmlContextData *ctxt, QQmlCompiledData *comp, int start, QQmlContextData *creation) { @@ -1326,7 +1328,7 @@ QQmlContextData *QQmlVME::complete(const Interrupt &interrupt) bindValues.deallocate(); } - if (!QQmlEnginePrivate::designerMode()) { // the qml designer does the component complete later + if (componentCompleteEnabled()) { // the qml designer does the component complete later QQmlTrace trace("VME Component Complete"); while (!parserStatus.isEmpty()) { QQmlParserStatus *status = parserStatus.pop(); @@ -1390,6 +1392,21 @@ QQmlContextData *QQmlVME::complete(const Interrupt &interrupt) return rv; } +void QQmlVME::enableComponentComplete() +{ + s_enableComponentComplete = true; +} + +void QQmlVME::disableComponentComplete() +{ + s_enableComponentComplete = false; +} + +bool QQmlVME::componentCompleteEnabled() +{ + return s_enableComponentComplete; +} + void QQmlVME::blank(QFiniteStack<QQmlAbstractBinding *> &bs) { for (int ii = 0; ii < bs.count(); ++ii) { diff --git a/src/qml/qml/qqmlvme_p.h b/src/qml/qml/qqmlvme_p.h index 62ba47f7ad..405a83c4fe 100644 --- a/src/qml/qml/qqmlvme_p.h +++ b/src/qml/qml/qqmlvme_p.h @@ -140,6 +140,10 @@ public: QObject *execute(QList<QQmlError> *errors, const Interrupt & = Interrupt()); QQmlContextData *complete(const Interrupt & = Interrupt()); + static void enableComponentComplete(); + static void disableComponentComplete(); + static bool componentCompleteEnabled(); + private: friend class QQmlVMEGuard; @@ -179,6 +183,8 @@ private: static void blank(QFiniteStack<QQmlParserStatus *> &); static void blank(QFiniteStack<QQmlAbstractBinding *> &); + + static bool s_enableComponentComplete; }; // Used to check that a QQmlVME that is interrupted mid-execution |