From 3fdec636980c23b14cfc6aa74bc48bbb960ba0b4 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Wed, 22 Apr 2015 13:39:06 +0200 Subject: Fix regression with nested objects served by custom parsers The following piece of code used to work and broke with Qt 5.3: ListModel { property var conn: Connection { ... } } When validating the properties of the ListModel we would not validate the Connection sub-object here, which meant the custom parser for the connection object was never called. We need to extend the logic for sub-object validation to recursive into sub-objects when this is either an attached property (Component.onComplete on a list model for example) or the object is assigned to an _existing_ property, i.e. a property not deal with by the custom parser. In this case that's a custom declared property. Change-Id: Ic99f746f08771460cc6424a9e8a839c78a7eafd9 Task-number: QTBUG-45735 Reviewed-by: Lars Knoll --- src/qml/compiler/qqmltypecompiler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/qml/compiler') diff --git a/src/qml/compiler/qqmltypecompiler.cpp b/src/qml/compiler/qqmltypecompiler.cpp index 4bdfe444f5..21846775a3 100644 --- a/src/qml/compiler/qqmltypecompiler.cpp +++ b/src/qml/compiler/qqmltypecompiler.cpp @@ -1891,7 +1891,7 @@ bool QQmlPropertyValidator::validateObject(int objectIndex, const QV4::CompiledD bool seenSubObjectWithId = false; - if (binding->type >= QV4::CompiledData::Binding::Type_Object && (!customParser || binding->type == QV4::CompiledData::Binding::Type_AttachedProperty)) { + if (binding->type >= QV4::CompiledData::Binding::Type_Object && (pd || binding->isAttachedProperty())) { qSwap(_seenObjectWithId, seenSubObjectWithId); const bool subObjectValid = validateObject(binding->value.objectIndex, binding, pd && QQmlValueTypeFactory::metaObjectForMetaType(pd->propType)); qSwap(_seenObjectWithId, seenSubObjectWithId); -- cgit v1.2.3