From 29b6d2e45c7434fccf2e6878630e62d5dcce38db Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Tue, 10 Dec 2013 15:25:22 +0100 Subject: Fix broken Maroon game / regression in PropertyChanges {} element Commit 0aadcf8077840068eb182269e9ed9c31ad12f45e that pre-compiles the expressions in PropertyChanges {} introduced a regression in where the evaluation context was incorrect and thus bindings would not be able to access the correct properties. For example PropertyChanges { target: someObject y: height / 2 } Here height should be looked up in the context of "someObject", not of the PropertyChanges element. This patch introduces an auto-test that verifies that the lookup context is correct and fixes the bug by disabling accelerated compile time property lookups for binding expressions that are requested from a custom parser. Change-Id: I5cb607d07211b453ddfc9928ccbf5f9ecec85575 Reviewed-by: Lars Knoll --- .../qqmllanguage/data/customParserBindingScopes.qml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 tests/auto/qml/qqmllanguage/data/customParserBindingScopes.qml (limited to 'tests/auto/qml/qqmllanguage/data/customParserBindingScopes.qml') diff --git a/tests/auto/qml/qqmllanguage/data/customParserBindingScopes.qml b/tests/auto/qml/qqmllanguage/data/customParserBindingScopes.qml new file mode 100644 index 0000000000..2efc199f32 --- /dev/null +++ b/tests/auto/qml/qqmllanguage/data/customParserBindingScopes.qml @@ -0,0 +1,19 @@ +import Test 1.0 +import QtQml 2.0 +QtObject { + id: root + + property int otherProperty: 10 + + property QtObject child: QtObject { + id: child + + property int testProperty; + property int otherProperty: 41 + + property QtObject customBinder: CustomBinding { + target: child + testProperty: otherProperty + 1 + } + } +} -- cgit v1.2.3