1import QtQuick 1.0
2
3Rectangle {
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                height: root.delegateHeight
21                width: root.delegateWidth
22                scale: root.delegateScale
23                color: PathView.isCurrentItem ? "lightsteelblue" : "white"
24                border.color: "black"
25                Text {
26                    text: index
27                }
28                Text {
29                    x: 20
30                    id: textName
31                    objectName: "textName"
32                    text: name
33                }
34                Text {
35                    x: 40
36                    id: textNumber
37                    objectName: "textNumber"
38                    text: number
39                }
40                PathView.onCurrentItemChanged: {
41                    if (PathView.isCurrentItem) {
42                        root.currentA = index;
43                        root.currentB = wrapper.PathView.view.currentIndex;
44                    }
45                }
46            }
47        }
48    ]
49    PathView {
50        id: view
51        objectName: "view"
52        width: 240
53        height: 320
54        model: testModel
55        delegate: delegate
56        highlight: Rectangle {
57            width: 60
58            height: 20
59            color: "yellow"
60        }
61        path: Path {
62            startY: 120
63            startX: 160
64            PathQuad {
65                y: 120
66                x: 80
67                controlY: 330
68                controlX: 100
69            }
70            PathLine {
71                y: 160
72                x: 20
73            }
74            PathCubic {
75                y: 120
76                x: 160
77                control1Y: 0
78                control1X: 100
79                control2Y: 000
80                control2X: 200
81            }
82        }
83    }
84}
85