aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2013-09-23 15:30:55 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-25 13:13:30 +0200
commitb3449f333bede37d6eaf24a1abc0d746e5b4b1a7 (patch)
treeede6cfa96134ef424e91a677aba9b55846a42c53 /src
parentcefcba03d734a774a3fe25fa3c3d8fea669473e3 (diff)
Fix bug in assigning to self-declared properties in child object literals
When createInstance() calls populateInstance, make sure that the QObject used for bindings is the instance we just created, not the _qobject from the caller side (which is completely wrong and unrelated). Change-Id: I7dc44ffaa70799b2f37258aeacdb33d8a1cf8c48 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/qml/qml/qqmlobjectcreator.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/qml/qml/qqmlobjectcreator.cpp b/src/qml/qml/qqmlobjectcreator.cpp
index c69906ecb9..f810445829 100644
--- a/src/qml/qml/qqmlobjectcreator.cpp
+++ b/src/qml/qml/qqmlobjectcreator.cpp
@@ -1270,7 +1270,7 @@ QObject *QmlObjectCreator::createInstance(int index, QObject *parent)
QQmlRefPointer<QQmlPropertyCache> cache = propertyCaches.value(index);
Q_ASSERT(!cache.isNull());
- if (!populateInstance(index, instance, cache, _qobject, /*value type property*/0))
+ if (!populateInstance(index, instance, cache, instance, /*value type property*/0))
return 0;
}
@@ -1327,8 +1327,7 @@ bool QmlObjectCreator::populateInstance(int index, QObject *instance, QQmlRefPoi
{
const QV4::CompiledData::Object *obj = qmlUnit->objectAt(index);
- if (!scopeObjectForBindings)
- scopeObjectForBindings = instance;
+ Q_ASSERT(scopeObjectForBindings);
QQmlData *declarativeData = QQmlData::get(instance, /*create*/true);