|
1 import Qt 4.7 |
|
2 |
|
3 Rectangle { |
|
4 width: 800; height: 450 |
|
5 |
|
6 ListModel { |
|
7 id: rssModel |
|
8 ListElement { lColor: "red" } |
|
9 ListElement { lColor: "green" } |
|
10 ListElement { lColor: "yellow" } |
|
11 ListElement { lColor: "blue" } |
|
12 ListElement { lColor: "purple" } |
|
13 ListElement { lColor: "gray" } |
|
14 ListElement { lColor: "brown" } |
|
15 ListElement { lColor: "thistle" } |
|
16 } |
|
17 |
|
18 Component { |
|
19 id: photoDelegate |
|
20 Rectangle { |
|
21 id: wrapper |
|
22 width: 85; height: 85; color: lColor |
|
23 scale: wrapper.PathView.scale |
|
24 |
|
25 MouseArea { anchors.fill: parent } |
|
26 |
|
27 transform: Rotation { |
|
28 id: itemRotation; origin.x: wrapper.width/2; origin.y: wrapper.height/2 |
|
29 axis.y: 1; axis.z: 0; angle: wrapper.PathView.angle |
|
30 } |
|
31 } |
|
32 } |
|
33 |
|
34 PathView { |
|
35 id: photoPathView; model: rssModel; delegate: photoDelegate |
|
36 y: 100; width: 800; height: 330; pathItemCount: 10; z: 1 |
|
37 path: Path { |
|
38 startX: -50; startY: 40; |
|
39 |
|
40 PathAttribute { name: "scale"; value: 0.5 } |
|
41 PathAttribute { name: "angle"; value: -45 } |
|
42 |
|
43 PathCubic { |
|
44 x: 400; y: 220 |
|
45 control1X: 140; control1Y: 40 |
|
46 control2X: 210; control2Y: 220 |
|
47 } |
|
48 |
|
49 PathAttribute { name: "scale"; value: 1.2 } |
|
50 PathAttribute { name: "angle"; value: 0 } |
|
51 |
|
52 PathCubic { |
|
53 x: 850; y: 40 |
|
54 control2X: 660; control2Y: 40 |
|
55 control1X: 590; control1Y: 220 |
|
56 } |
|
57 |
|
58 PathAttribute { name: "scale"; value: 0.5 } |
|
59 PathAttribute { name: "angle"; value: 45 } |
|
60 } |
|
61 } |
|
62 } |