add new rotation demo and pathview demo
[devdays2011:devdays2011.git] / qml / demos / listview_demo.qml
1 import QtQuick 1.1
2 import ".."
3
4 ListView {
5     id: root
6     width: parent.width
7     height: 400
8     spacing: 1
9     model: 200
10     orientation: ListView.Horizontal
11
12     delegate:
13         Rectangle {
14         id: plate
15         width: 50
16         height: ListView.view.height
17         color: "lightslategrey"
18         smooth: true
19         opacity: 0
20         clip: true
21
22         AnimatedText {
23             anchors.centerIn: parent
24             text: index+"-------------"
25             textColor: "white"
26             altTextColor: "mediumvioletred"
27             rotation: 90
28         }
29
30         ParallelAnimation {
31             id: delegateItemAnim
32             NumberAnimation {
33                 target: plate
34                 properties: "opacity"
35                 easing.type: Easing.OutCubic
36                 from: 0
37                 to: 1
38                 duration: 800
39             }
40             NumberAnimation {
41                 target: plate
42                 properties: "height"
43                 easing.type: Easing.OutElastic
44                 from: 0
45                 to: plate.ListView.view.height
46                 duration: 8000
47             }
48         }
49
50         Component.onCompleted: delegateItemAnim.restart()
51     }
52 }