Debian Codegraph @

tests/manual/scenegraph_lancelot/data/rectangles/test-rectangles.qml

raw
1 import QtQuick 2.0
2
3 Rectangle {
4 width: 320
5 height: 480
6 Column {
7 id: foo
8 x: -width * (scale - 1) * (10/9) * (mouseArea.mouseX / width - 0.5)
9 y: -height * (scale - 1) * (10/9) * (mouseArea.mouseY / height - 0.5)
10 states: [
11 State {
12 name: ""
13 PropertyChanges {
14 target: foo
15 scale: 1
16 }
17 },
18 State {
19 name: "zoomed"
20 when: mouseArea.pressed
21 PropertyChanges {
22 target: foo
23 scale: 10
24 }
25 }
26 ]
27 Behavior on scale {
28 NumberAnimation { duration: 300; easing.type: Easing.InOutSine }
29 }
30
31 Repeater {
32 model: 3
33 Row {
34 id: local
35 property int _index: index
36 Repeater {
37 model: 2
38 Item {
39 width: 80
40 height: 160
41 Rectangle {
42 anchors.fill: parent
43 anchors.margins: 10
44 radius: index * 20
45 border.pixelAligned: local._index == 1
46 border.width: local._index == 0 ? 0 : 0.5
47 opacity: 0.5
48 color: "steelBlue"
49 }
50 }
51 }
52 Repeater {
53 model: 2
54 Item {
55 width: 80
56 height: 160
57 Rectangle {
58 anchors.fill: parent
59 anchors.margins: 10
60 radius: index * 20
61 border.pixelAligned: local._index == 1
62 border.width: local._index == 0 ? 0 : 0.5
63 opacity: 0.5
64 gradient: Gradient {
65 GradientStop { position: 0.05; color: "lightsteelblue" }
66 GradientStop { position: 0.1; color: "lightskyblue" }
67 GradientStop { position: 0.5; color: "skyblue" }
68 GradientStop { position: 0.9; color: "deepskyblue" }
69 GradientStop { position: 0.95; color: "dodgerblue" }
70 }
71 }
72 }
73 }
74 }
75 }
76 }
77 MouseArea {
78 id: mouseArea
79 anchors.fill: parent
80 }
81 }