diff options
Diffstat (limited to 'tests/auto/qml/qqmlvaluetypes/data/variant_write.1.qml')
-rw-r--r-- | tests/auto/qml/qqmlvaluetypes/data/variant_write.1.qml | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlvaluetypes/data/variant_write.1.qml b/tests/auto/qml/qqmlvaluetypes/data/variant_write.1.qml new file mode 100644 index 0000000000..6063917dd4 --- /dev/null +++ b/tests/auto/qml/qqmlvaluetypes/data/variant_write.1.qml @@ -0,0 +1,25 @@ +import QtQuick 2.0 + +Item { + property bool complete: false + property bool success: false + + property variant v1: Qt.vector3d(1,2,3) + property variant v2: Qt.vector3d(4,5,6) + property variant v3: v1.plus(v2) // set up doomed binding + + Component.onCompleted: { + complete = false; + success = true; + + v1 = Qt.vector2d(1,2) // changing the type of the property shouldn't cause crash + + v1.x = 8; + v2.x = 9; + + if (v1 != Qt.vector2d(8,2)) success = false; + if (v2 != Qt.vector3d(9,5,6)) success = false; + + complete = true; + } +} |