diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2014-02-06 16:33:15 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-02-07 12:44:10 +0100 |
commit | 324ae0d7d99ef9f7159d29b2e0e7eabe5f8a43a4 (patch) | |
tree | 9576687c7580065e819392a3be6250dcf6e0c07c /src/qml/qml/qqmlobjectcreator.cpp | |
parent | 50ce88a53107f97664d928719c1877b8077e9a2e (diff) |
[new compiler] Allow for interruption during object finalization
The object tree construction and binding allocation remains synchronous, but
the initial evaluation of the bindings is now cooperatively interruptible
again, like in the VME.
Change-Id: Idd037dd481782c81ad43e20e93d922eb12ac8b85
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/qml/qqmlobjectcreator.cpp')
-rw-r--r-- | src/qml/qml/qqmlobjectcreator.cpp | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/src/qml/qml/qqmlobjectcreator.cpp b/src/qml/qml/qqmlobjectcreator.cpp index 2b69955dde..faeb3753ea 100644 --- a/src/qml/qml/qqmlobjectcreator.cpp +++ b/src/qml/qml/qqmlobjectcreator.cpp @@ -1048,13 +1048,16 @@ QObject *QmlObjectCreator::createInstance(int index, QObject *parent) return result ? instance : 0; } -QQmlContextData *QmlObjectCreator::finalize() +QQmlContextData *QmlObjectCreator::finalize(QQmlInstantiationInterrupt &interrupt) { { QQmlTrace trace("VME Binding Enable"); trace.event("begin binding eval"); while (!allCreatedBindings->isEmpty()) { + if (interrupt.shouldInterrupt()) + return 0; + QQmlAbstractBinding *b = allCreatedBindings->pop(); if (!b) continue; @@ -1077,10 +1080,8 @@ QQmlContextData *QmlObjectCreator::finalize() status->componentComplete(); } - #if 0 // ### - if (watcher.hasRecursed() || interrupt.shouldInterrupt()) - return 0; - #endif + if (interrupt.shouldInterrupt()) + return 0; } } @@ -1093,10 +1094,6 @@ QQmlContextData *QmlObjectCreator::finalize() void *args[] = { 0 }; QMetaObject::metacall(obj, QMetaObject::InvokeMetaMethod, callback.second, args); } -#if 0 // ### - if (watcher.hasRecursed()) - return 0; -#endif } finalizeCallbacks.clear(); } @@ -1113,10 +1110,8 @@ QQmlContextData *QmlObjectCreator::finalize() // ### designer if (componentCompleteEnabled()) emit a->completed(); -#if 0 // ### - if (watcher.hasRecursed() || interrupt.shouldInterrupt()) + if (interrupt.shouldInterrupt()) return 0; -#endif } } |