Rename Qt Quick-specific classes to QQuick*
[profile/ivi/qtdeclarative.git] / tests / auto / declarative / qquickpathview / data / pathview0.qml
1 import QtQuick 2.0
2
3 Rectangle {
4     id: root
5     property int count: view.count
6     property int currentA: -1
7     property int currentB: -1
8     property real delegateWidth: 60
9     property real delegateHeight: 20
10     property real delegateScale: 1.0
11     width: 240
12     height: 320
13     color: "#ffffff"
14     resources: [
15         Component {
16             id: delegate
17             Rectangle {
18                 id: wrapper
19                 objectName: "wrapper"
20                 property bool onPath: PathView.onPath
21                 height: root.delegateHeight
22                 width: root.delegateWidth
23                 scale: root.delegateScale
24                 color: PathView.isCurrentItem ? "lightsteelblue" : "white"
25                 border.color: "black"
26                 Text {
27                     text: index
28                 }
29                 Text {
30                     x: 20
31                     id: textName
32                     objectName: "textName"
33                     text: name
34                 }
35                 Text {
36                     x: 40
37                     id: textNumber
38                     objectName: "textNumber"
39                     text: number
40                 }
41                 PathView.onCurrentItemChanged: {
42                     if (PathView.isCurrentItem) {
43                         root.currentA = index;
44                         root.currentB = wrapper.PathView.view.currentIndex;
45                     }
46                 }
47             }
48         }
49     ]
50     PathView {
51         id: view
52         objectName: "view"
53         width: 240
54         height: 320
55         model: testModel
56         delegate: delegate
57         highlight: Rectangle {
58             width: 60
59             height: 20
60             color: "yellow"
61         }
62         path: Path {
63             startY: 120
64             startX: 160
65             PathQuad {
66                 y: 120
67                 x: 80
68                 controlY: 330
69                 controlX: 100
70             }
71             PathLine {
72                 y: 160
73                 x: 20
74             }
75             PathCubic {
76                 y: 120
77                 x: 160
78                 control1Y: 0
79                 control1X: 100
80                 control2Y: 000
81                 control2X: 200
82             }
83         }
84     }
85 }