diff options
Diffstat (limited to 'tests/auto/qml/qmllint/data/scriptstring.qml')
-rw-r--r-- | tests/auto/qml/qmllint/data/scriptstring.qml | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/tests/auto/qml/qmllint/data/scriptstring.qml b/tests/auto/qml/qmllint/data/scriptstring.qml new file mode 100644 index 0000000000..733434e924 --- /dev/null +++ b/tests/auto/qml/qmllint/data/scriptstring.qml @@ -0,0 +1,73 @@ +import QtQuick + +Window { + id: root + + Rectangle { + id: main + + MouseArea { + id: mouse + property int clickCount: 0 + onClicked: { + clickCount++ + + switch ( clickCount % 3 ) { + case 1 : + main.state = "middleState" + break + case 2 : + main.state = "rightState" + break + default : + main.state = "leftState" + } + } + } + + Rectangle { + id: mover + anchors { + left: undefined + right: undefined + horizontalCenter: undefined + top: main.top + bottom: main.bottom + } + } + + states: [ + State { + name: "leftState" + AnchorChanges { + target: mover + anchors.left: main.left + anchors.right: undefined + anchors.horizontalCenter: undefined + } + }, + State { + name: "middleState" + AnchorChanges { + target: mover + anchors { + left: undefined + right: undefined + horizontalCenter: main.horizontalCenter + } + } + }, + State { + name: "rightState" + AnchorChanges { + target: mover + anchors { + left: undefined + right: main.right + horizontalCenter: undefined + } + } + } + ] + } +} |