4687776e0b531c63ab5aca4b7565363c38a83acb
[profile/ivi/qtdeclarative.git] / tests / auto / quick / qquickpathview / data / pathview3.qml
1 import QtQuick 2.0
2
3 PathView {
4     id: photoPathView
5     property bool enforceRange: true
6     width: 800; height: 330; pathItemCount: 4; offset: 1
7     dragMargin: 24
8     highlightRangeMode: enforceRange ? PathView.StrictlyEnforceRange : PathView.NoHighlightRange
9     preferredHighlightBegin: 0.50
10     preferredHighlightEnd: 0.50
11
12     function addColor(color) {
13         model.append({"lColor":color})
14     }
15
16     path: Path {
17         startX: -50; startY: 40;
18
19         PathAttribute { name: "scale"; value: 0.5 }
20         PathAttribute { name: "angle"; value: -45 }
21
22         PathCubic {
23             x: 400; y: 220
24             control1X: 140; control1Y: 40
25             control2X: 210; control2Y: 220
26         }
27
28         PathAttribute { name: "scale"; value: 1.2  }
29         PathAttribute { name: "angle"; value: 0 }
30
31         PathCubic {
32             x: 850; y: 40
33             control2X: 660; control2Y: 40
34             control1X: 590; control1Y: 220
35         }
36
37         PathAttribute { name: "scale"; value: 0.5 }
38         PathAttribute { name: "angle"; value: 45 }
39     }
40
41     model: ListModel {
42         ListElement { lColor: "red" }
43         ListElement { lColor: "green" }
44         ListElement { lColor: "yellow" }
45         ListElement { lColor: "blue" }
46         ListElement { lColor: "purple" }
47         ListElement { lColor: "gray" }
48         ListElement { lColor: "brown" }
49         ListElement { lColor: "thistle" }
50     }
51
52     delegate: Component {
53         id: photoDelegate
54         Rectangle {
55             id: wrapper
56             objectName: "wrapper"
57             width: 85; height: 85; color: lColor
58
59             Text { text: index }
60
61             transform: Rotation {
62                 id: itemRotation; origin.x: wrapper.width/2; origin.y: wrapper.height/2
63                 axis.y: 1; axis.z: 0
64             }
65         }
66     }
67
68     Text { text: "Offset: " + photoPathView.offset }
69 }