diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2014-03-17 14:42:05 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-03-17 15:45:45 +0100 |
commit | acf1298e21abd2fb12d8364c593fbbff345374bc (patch) | |
tree | 30533bedc74cbf5f55ba767c34daa694e746c865 /tests/auto/qml/qqmlecmascript/data | |
parent | 3f362cdf9304afeed06081cd5abfcaf6aaabe19e (diff) |
Fix crash with lazy binding initialization and compile time calculated dependencies
During lazy binding initialization we may execute bindings where we calculated
dependencies to the context object at compile time. In order to register those
dependencies, the contet object needs to be set in the QQmlContextData.
This patch makes sure to set it before setting up the bindings.
Change-Id: Iacd360140cd9c389487bda82f6a7e6cc3a44c154
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'tests/auto/qml/qqmlecmascript/data')
-rw-r--r-- | tests/auto/qml/qqmlecmascript/data/SubObject.qml | 8 | ||||
-rw-r--r-- | tests/auto/qml/qqmlecmascript/data/contextObjectOnLazyBindings.qml | 10 |
2 files changed, 18 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlecmascript/data/SubObject.qml b/tests/auto/qml/qqmlecmascript/data/SubObject.qml new file mode 100644 index 0000000000..4658edd1db --- /dev/null +++ b/tests/auto/qml/qqmlecmascript/data/SubObject.qml @@ -0,0 +1,8 @@ +import QtQml 2.0 +QtObject { + property int testValue: -1 + property int subValue; + onSubValueChanged: { + testValue = this.someExpression + } +} diff --git a/tests/auto/qml/qqmlecmascript/data/contextObjectOnLazyBindings.qml b/tests/auto/qml/qqmlecmascript/data/contextObjectOnLazyBindings.qml new file mode 100644 index 0000000000..33b21c74a8 --- /dev/null +++ b/tests/auto/qml/qqmlecmascript/data/contextObjectOnLazyBindings.qml @@ -0,0 +1,10 @@ +import QtQml 2.0 +QtObject { + property SubObject subObject: SubObject { + subValue: 20; + property int someExpression: { + return someValue; + } + } + property int someValue: 42 +} |