aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qmlvisual/animation/bindinganimation/bindinganimation.qml
blob: 901981263ca33b497c8fd331ff2d239bb36f9ec8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import QtQuick 1.0

Rectangle {
    color: "blue"
    width: 320
    height: 240
    id: page
    Rectangle {
        id: myRectangle
        width: 100
        height: 100
        color: "red"
        x: 10
    }
    states: [
        State {
            when: myMouseArea.pressed
            name: "hello"
            PropertyChanges {
                target: myRectangle
                x: 50 + 50
            }
        }
    ]
    transitions: [
        Transition {
            NumberAnimation {
                properties: "x"
            }
        }
    ]
    MouseArea {
        id: myMouseArea
        anchors.fill: parent
    }
}