qt6-bb10/qtdeclarative/tests/auto/quick/qquickanimations/data/propertiesTransition4.qml

30 lines
534 B
QML

import QtQuick 2.0
Rectangle {
width: 400
height: 400
Rectangle {
id: theRect
objectName: "TheRect"
color: "red"
width: 50; height: 50
x: 100; y: 100
}
states: State {
name: "moved"
PropertyChanges {
target: theRect
x: 200
}
}
transitions: Transition {
NumberAnimation { target: theRect; properties: "x" }
}
MouseArea {
anchors.fill: parent
onClicked: parent.state = "moved"
}
}