diff options
author | Fabian Kosmale <fabian.kosmale@qt.io> | 2019-07-04 10:39:43 +0200 |
---|---|---|
committer | Fabian Kosmale <fabian.kosmale@qt.io> | 2019-07-04 12:29:41 +0200 |
commit | 9db3ec26136aa7a7ea58c85c92f5c6288e50e8f5 (patch) | |
tree | 042b46fecfbe3087868fc18f3b31386bd8663ea6 /tests/auto/qml/qqmlbinding/data | |
parent | 341ab7708049b1a3f559b76f16393e688951a938 (diff) |
Fix crash when binding to QML component
As the properties were missing their context, we could not get the
correct QMetaObject and would trigger an assertion in canConvert. We now
always set the context when creating QQmlProperties in qqmlbind.
Fixes: QTBUG-40487
Change-Id: I766c5697dc33fc1e18c2316e28d944975e84ae3c
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'tests/auto/qml/qqmlbinding/data')
-rw-r--r-- | tests/auto/qml/qqmlbinding/data/MyComponent.qml | 2 | ||||
-rw-r--r-- | tests/auto/qml/qqmlbinding/data/bindToQMLComponent.qml | 12 |
2 files changed, 14 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlbinding/data/MyComponent.qml b/tests/auto/qml/qqmlbinding/data/MyComponent.qml new file mode 100644 index 0000000000..5892539a5d --- /dev/null +++ b/tests/auto/qml/qqmlbinding/data/MyComponent.qml @@ -0,0 +1,2 @@ +import QtQuick 2.3 +QtObject { property real p: 0 } diff --git a/tests/auto/qml/qqmlbinding/data/bindToQMLComponent.qml b/tests/auto/qml/qqmlbinding/data/bindToQMLComponent.qml new file mode 100644 index 0000000000..471db9023b --- /dev/null +++ b/tests/auto/qml/qqmlbinding/data/bindToQMLComponent.qml @@ -0,0 +1,12 @@ +import QtQuick 2.0 + +Item { + id: root + property MyComponent myProperty + Binding { + target: root + property: "myProperty" + value: myObject + } + MyComponent { id: myObject } +} |