~loic.molinari/+junk/qtdeclarative-shadereffectsource-changes

« back to all changes in this revision

Viewing changes to tests/auto/quick/qquickanimations/data/pathTransition.qml

  • Committer: Loïc Molinari
  • Date: 2012-04-21 17:59:51 UTC
  • Revision ID: loic.molinari@canonical.com-20120421175951-bqx68caaf5zrp76l
Initial import

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
import QtQuick 2.0
 
2
 
 
3
Rectangle {
 
4
    width: 800
 
5
    height: 800
 
6
 
 
7
    Rectangle {
 
8
        id: redRect; objectName: "redRect"
 
9
        color: "red"
 
10
        width: 50; height: 50
 
11
        x: 500; y: 50
 
12
    }
 
13
 
 
14
    states: State {
 
15
        name: "moved"
 
16
        PropertyChanges {
 
17
            target: redRect
 
18
            x: 100; y: 700
 
19
        }
 
20
    }
 
21
 
 
22
    transitions: Transition {
 
23
        to: "moved"; reversible: true
 
24
        PathAnimation {
 
25
            id: pathAnim
 
26
            target: redRect
 
27
            duration: 300
 
28
            path: Path {
 
29
                PathCurve { x: 100; y: 100 }
 
30
                PathCurve { x: 200; y: 350 }
 
31
                PathCurve { x: 600; y: 500 }
 
32
                PathCurve {}
 
33
            }
 
34
        }
 
35
    }
 
36
 
 
37
    MouseArea {
 
38
        anchors.fill: parent
 
39
        onClicked: parent.state = parent.state == "moved" ? "" : "moved"
 
40
    }
 
41
}