diff options
author | Fabian Kosmale <fabian.kosmale@qt.io> | 2019-07-22 13:41:11 +0200 |
---|---|---|
committer | Fabian Kosmale <fabian.kosmale@qt.io> | 2019-07-22 16:00:52 +0200 |
commit | da14688140550879e376e71cf273b16494e6c3c4 (patch) | |
tree | 6f7e77721b1277f4039ea1e7dd0c64d5f81fefab /tests/auto/qml/qqmlproperty/data | |
parent | b0e19e1d08e17a7fd76008447be0f788ebf73f1f (diff) |
Fix nullptr handling in binding
Fixes: QTBUG-77027
Change-Id: I61d5a20329ffe95af810b89e338eee2bc10bfe04
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'tests/auto/qml/qqmlproperty/data')
-rw-r--r-- | tests/auto/qml/qqmlproperty/data/nullPropertyBinding.qml | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlproperty/data/nullPropertyBinding.qml b/tests/auto/qml/qqmlproperty/data/nullPropertyBinding.qml new file mode 100644 index 0000000000..4fffc7aead --- /dev/null +++ b/tests/auto/qml/qqmlproperty/data/nullPropertyBinding.qml @@ -0,0 +1,22 @@ +import QtQuick 2.12 + +Item { + id: root + + width: 640 + height: 480 + + property bool toggle: false + property Item bound + property string message: "defined" + + readonly property Item item: root.toggle ? root : null + + Binding { target: root; property: "bound"; value: item} + + function tog() { + console.info(root.bound ? root.bound.message: "undefined") + root.toggle = !root.toggle + return 42; + } +} |