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