Fix regression with nested objects served by custom parsers
authorSimon Hausmann <simon.hausmann@theqtcompany.com>
Wed, 22 Apr 2015 11:39:06 +0000 (13:39 +0200)
committerSimon Hausmann <simon.hausmann@theqtcompany.com>
Thu, 23 Apr 2015 08:27:43 +0000 (08:27 +0000)
commit3fdec636980c23b14cfc6aa74bc48bbb960ba0b4
tree8e7dad673bfbd8e38fe6974088eb914ac18da8b1
parent346abd22118c81e8434ff5a2a7694bd81fe17be1
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 <lars.knoll@digia.com>
src/qml/compiler/qqmltypecompiler.cpp
tests/auto/qml/qqmllanguage/data/nestedCustomParsers.qml [new file with mode: 0644]
tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp