aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlvme.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2014-02-27 14:30:09 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-04 15:22:58 +0100
commit186f8e2f76dc6995d14e6632d9b9d704198feda2 (patch)
tree6213cee17297940c46c9ff0a52160a42152d0b4a /src/qml/qml/qqmlvme.cpp
parentb02bed1caae6966925b9efb04e1db79c3e9ef687 (diff)
[new compiler] Fix some qqmlincubator tests
We need to track the objects created and pass them over to the VME guard used in the incubator. The incremental build nature of the incubator requires that to avoid crashes. For nested incubators we need to set the activeVMEData field in the root QQmlContext, to allow child incubators to locate the parent. Lastly we need can emulate most of the VME behavior in terms of build states when running with QQmlInstantiationInterrupt by presenting four build steps: The initial state, two build steps, a finalization step and the state when we're done. Change-Id: I16cd7f71744decb9d4735ec77e9d944fad18e88d Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/qml/qqmlvme.cpp')
-rw-r--r--src/qml/qml/qqmlvme.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/qml/qml/qqmlvme.cpp b/src/qml/qml/qqmlvme.cpp
index 24f4a65392..15401e269b 100644
--- a/src/qml/qml/qqmlvme.cpp
+++ b/src/qml/qml/qqmlvme.cpp
@@ -1329,6 +1329,13 @@ void QQmlVMEGuard::guard(QQmlVME *vme)
void QQmlVMEGuard::guard(QQmlObjectCreator *creator)
{
clear();
+
+ QFiniteStack<QObject*> &objects = creator->allCreatedObjects();
+ m_objectCount = objects.count();
+ m_objects = new QPointer<QObject>[m_objectCount];
+ for (int ii = 0; ii < m_objectCount; ++ii)
+ m_objects[ii] = objects[ii];
+
m_contextCount = 1;
m_contexts = new QQmlGuardedContextData[m_contextCount];
m_contexts[0] = creator->parentContextData();