diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2013-10-04 02:37:53 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-01-08 10:04:35 +0100 |
commit | 4a662c21e669e964f9c3b835a91a38c9decf4ad4 (patch) | |
tree | a3921e3303336b59b59aba386dcf683cc241d087 /src/qml/qml/qqmlincubator.cpp | |
parent | 4b9a44274563b8cc0a9d98f86893df3f31f01307 (diff) |
[new compiler] Preliminary support for QQmlIncubator
Just enough to run some unit tests that use QQuickLoader, components are
created instantly.
Change-Id: I1c827aa946d3e2a60ccc220bb79572aca2ed8c96
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/qml/qqmlincubator.cpp')
-rw-r--r-- | src/qml/qml/qqmlincubator.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/qml/qml/qqmlincubator.cpp b/src/qml/qml/qqmlincubator.cpp index ade4634c2d..52bf1d8b3e 100644 --- a/src/qml/qml/qqmlincubator.cpp +++ b/src/qml/qml/qqmlincubator.cpp @@ -46,6 +46,7 @@ #include "qqmlcompiler_p.h" #include "qqmlexpression_p.h" #include "qqmlmemoryprofiler_p.h" +#include "qqmlobjectcreator_p.h" // XXX TODO // - check that the Component.onCompleted behavior is the same as 4.8 in the synchronous and @@ -292,7 +293,14 @@ void QQmlIncubatorPrivate::incubate(QQmlVME::Interrupt &i) if (progress == QQmlIncubatorPrivate::Execute) { enginePriv->referenceScarceResources(); - QObject *tresult = vme.execute(&errors, i); + QObject *tresult = 0; + if (enginePriv->useNewCompiler) { + tresult = creator->create(subComponentToCreate); + if (!tresult) + errors = creator->errors; + } else { + tresult = vme.execute(&errors, i); + } enginePriv->dereferenceScarceResources(); if (watcher.hasRecursed()) @@ -335,7 +343,11 @@ void QQmlIncubatorPrivate::incubate(QQmlVME::Interrupt &i) if (watcher.hasRecursed()) return; - QQmlContextData *ctxt = vme.complete(i); + QQmlContextData *ctxt = 0; + if (enginePriv->useNewCompiler) + ctxt = creator->finalize(); + else + ctxt = vme.complete(i); if (ctxt) { rootContext = ctxt; progress = QQmlIncubatorPrivate::Completed; @@ -566,6 +578,7 @@ void QQmlIncubator::clear() d->vme.reset(); d->vmeGuard.clear(); + d->creator.reset(0); Q_ASSERT(d->compiledData == 0); Q_ASSERT(d->waitingOnMe.data() == 0); |