diff options
Diffstat (limited to 'tests/auto/quick/qquickstates/data')
3 files changed, 70 insertions, 1 deletions
diff --git a/tests/auto/quick/qquickstates/data/anchorRewind.qml b/tests/auto/quick/qquickstates/data/anchorRewind.qml new file mode 100644 index 0000000000..740c94cf42 --- /dev/null +++ b/tests/auto/quick/qquickstates/data/anchorRewind.qml @@ -0,0 +1,31 @@ +import QtQuick + +Item { + width: 400 + height: 400 + Item { + id: outer + anchors.fill: parent + Item { + id: inner + width: parent.width / 2 + height: parent.height / 2 + anchors.left: parent.right + anchors.top: parent.bottom + } + states: [ + State { + when: true + AnchorChanges { + target: inner + anchors.left: outer.left + anchors.top: outer.top + } + } + ] + transitions: Transition { + AnchorAnimation {} + } + } +} + diff --git a/tests/auto/quick/qquickstates/data/noStateOsciallation.qml b/tests/auto/quick/qquickstates/data/noStateOsciallation.qml new file mode 100644 index 0000000000..f0d7aeeb6d --- /dev/null +++ b/tests/auto/quick/qquickstates/data/noStateOsciallation.qml @@ -0,0 +1,22 @@ +import QtQuick 2.15 + +Item { + id: root + property int number: 2 + property int stateChangeCounter: 0 + + Item { + id: item + onStateChanged: ++stateChangeCounter + states: [ + State { + name: "n1" + when: root.number === 1 + }, + State { + name: "n2" + when: root.number === 2 + } + ] + } +} diff --git a/tests/auto/quick/qquickstates/data/parentChangeInvolvingBindings.qml b/tests/auto/quick/qquickstates/data/parentChangeInvolvingBindings.qml index 9680e806b8..d3873883cd 100644 --- a/tests/auto/quick/qquickstates/data/parentChangeInvolvingBindings.qml +++ b/tests/auto/quick/qquickstates/data/parentChangeInvolvingBindings.qml @@ -3,25 +3,41 @@ import QtQuick Item { id: root property alias childWidth: firstChild.width + property alias childX: firstChild.x property alias childRotation: firstChild.rotation property double myrotation: 100 property double myrotation2: 200 height: 400 + y: 40 Item { id: firstChild height: parent.height width: height + y: parent.y + x: y rotation: root.myrotation + + Item { + id: inner + anchors.fill: parent + } } states: State { name: "reparented" - ParentChange { target: firstChild; parent: otherChild; width: 2*height; rotation: root.myrotation2} + ParentChange { + target: firstChild + parent: otherChild + width: 2 *height + x: 2 * y + rotation: root.myrotation2 + } } Item { height: parent.height + y: parent.y id: otherChild } } |