make pathview demo demoable
[devdays2011:devdays2011.git] / qml / demos / pathview_demo.qml
1 import QtQuick 1.1
2 import ".."
3
4 PathView {
5     id: root
6     width: parent.width
7     height: 400
8     model: 10
9
10     property variant images : ["shutdown.png", "sleep.png", "logoff.png", "lock.png"]
11
12     delegate: Image {
13         id: delegate
14         source: "../images/demos/" + root.images[index%4]
15         smooth: true
16         opacity: PathView.iconOpacity
17         scale: PathView.iconScale
18         z: PathView.iconZ
19
20         MouseArea {
21             anchors.fill: parent
22 //            onClicked: animation.restart()
23         }
24     }
25
26     path: Path {
27         id: myPath
28         startX: -100
29         startY: root.height/2
30 //        PathAttribute { name: "iconScale"; value: 1.0 }
31 //        PathAttribute { name: "iconOpacity"; value: 0.2 }
32 //        PathAttribute { name: "iconZ"; value: 0 }
33         PathQuad { id: pathPoint1; x: root.width/2; y: root.height/2; controlX: root.width/4; controlY: root.height/2 }
34 //        PathAttribute { name: "iconScale"; value: 2 }
35 //        PathAttribute { name: "iconOpacity"; value: 1 }
36 //        PathAttribute { name: "iconZ"; value: 1000 }
37         PathQuad { id: pathPoint2; x: root.width+100; y: root.height/2; controlX: 3*root.width/4; controlY: root.height/2 }
38 //        PathAttribute { name: "iconScale"; value: 1.0 }
39 //        PathAttribute { name: "iconOpacity"; value: 0.2 }
40 //        PathAttribute { name: "iconZ"; value: 0 }
41     }
42
43 //    SequentialAnimation {
44 //        id: animation
45
46 //        ParallelAnimation {
47 //            PropertyAnimation { target: pathPoint1; property: "controlY"; to: root.height/2.0; duration: 1000; easing.type: Easing.OutElastic }
48 //            PropertyAnimation { target: pathPoint2; property: "controlY"; to: root.height/2.0; duration: 1000; easing.type: Easing.OutElastic }
49 //        }
50 //        ParallelAnimation {
51 //            PropertyAnimation { target: pathPoint1; property: "controlY"; to: root.height*2; duration: 1000; easing.type: Easing.OutElastic }
52 //            PropertyAnimation { target: pathPoint2; property: "controlY"; to: 0; duration: 1000; easing.type: Easing.OutElastic }
53 //        }
54 //    }
55 }