diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2014-02-06 21:15:54 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-02-07 12:44:14 +0100 |
commit | 89c8e1e4a398c68daceb820950855cde5297e23a (patch) | |
tree | b13e0a4898bed2b2e1359ba7b2ba7c9109c89da1 /src/qml/qml/qqmlobjectcreator.cpp | |
parent | 1583093081d6d74acd7618880c7d6101961f47ad (diff) |
[new compiler] Fix component attachment linking across sub object creators
This brings up the list view in the components gallery.
Change-Id: Ib91ca3b30b8093acad0343b47be60cf4b51e4da7
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/qml/qqmlobjectcreator.cpp')
-rw-r--r-- | src/qml/qml/qqmlobjectcreator.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/qml/qml/qqmlobjectcreator.cpp b/src/qml/qml/qqmlobjectcreator.cpp index faeb3753ea..e2063a979f 100644 --- a/src/qml/qml/qqmlobjectcreator.cpp +++ b/src/qml/qml/qqmlobjectcreator.cpp @@ -110,6 +110,9 @@ QmlObjectCreator::QmlObjectCreator(QQmlContextData *parentContext, QQmlCompiledD if (!compiledData->isInitialized()) compiledData->initialize(engine); + componentAttachedImpl = 0; + componentAttached = &componentAttachedImpl; + if (inheritedBindingStack) { Q_ASSERT(rootContext); Q_ASSERT(inheritedParserStatusStack); @@ -974,13 +977,12 @@ QObject *QmlObjectCreator::createInstance(int index, QObject *parent) return 0; } QmlObjectCreator subCreator(context, typeRef->component, creationContext, rootContext, allCreatedBindings, allParserStatusCallbacks); + subCreator.componentAttached = componentAttached; instance = subCreator.create(); if (!instance) { errors += subCreator.errors; return 0; } - if (subCreator.componentAttached) - subCreator.componentAttached->add(&componentAttached); } // ### use no-event variant if (parent) @@ -1100,8 +1102,8 @@ QQmlContextData *QmlObjectCreator::finalize(QQmlInstantiationInterrupt &interrup { QQmlTrace trace("VME Component.onCompleted Callbacks"); - while (componentAttached) { - QQmlComponentAttached *a = componentAttached; + while (componentAttachedImpl) { + QQmlComponentAttached *a = componentAttachedImpl; a->rem(); QQmlData *d = QQmlData::get(a->parent()); Q_ASSERT(d); |