aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2023-09-27 10:47:54 +0200
committerShawn Rutledge <shawn.rutledge@qt.io>2023-09-27 21:16:05 +0200
commit251fdf01a65a52414dd9183308520efbbd731567 (patch)
tree6a0af5e23f2f016c31807039028956506d1341d6 /examples/quick
parent94ca4ad6d55fae3627df7c8e44e58cdf2dc9bb28 (diff)
Rename shapes example qml files according to what they demonstrate
Amends 270a6f9bba75478204dc6aadb348cf34a195a4da Fixes: QTBUG-115485 Pick-to: 6.2 6.5 6.6 6.6.0 Change-Id: Id77b4dd8ce83175ebe29d24bf987572d5e9069d7 Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
Diffstat (limited to 'examples/quick')
-rw-r--r--examples/quick/shapes/dashPattern.qml120
-rw-r--r--examples/quick/shapes/linearGradient.qml97
-rw-r--r--examples/quick/shapes/radialGradient.qml103
-rw-r--r--examples/quick/shapes/shapegallery.qml6
4 files changed, 163 insertions, 163 deletions
diff --git a/examples/quick/shapes/dashPattern.qml b/examples/quick/shapes/dashPattern.qml
index 87db319c9a..742f8622e9 100644
--- a/examples/quick/shapes/dashPattern.qml
+++ b/examples/quick/shapes/dashPattern.qml
@@ -9,104 +9,34 @@ Rectangle {
width: 256
height: 256
Shape {
- width: 200
- height: 150
- anchors.centerIn: parent
+ id: shape
+ anchors.fill: parent
+
ShapePath {
- strokeWidth: 4
- strokeColor: "red"
- fillGradient: RadialGradient {
- centerX: 100
- centerY: 100
- centerRadius: 100
- SequentialAnimation on focalRadius {
- loops: Animation.Infinite
- NumberAnimation {
- from: 1
- to: 20
- duration: 2000
- }
- NumberAnimation {
- from: 20
- to: 1
- duration: 2000
- }
- }
- SequentialAnimation on focalX {
- loops: Animation.Infinite
- NumberAnimation {
- from: 50
- to: 150
- duration: 3000
- }
- NumberAnimation {
- from: 150
- to: 50
- duration: 3000
- }
- }
- SequentialAnimation on focalY {
- loops: Animation.Infinite
- NumberAnimation {
- from: 50
- to: 150
- duration: 1000
- }
- NumberAnimation {
- from: 150
- to: 50
- duration: 1000
- }
- }
- GradientStop {
- position: 0
- color: "#ffffff"
- }
- GradientStop {
- position: 0.11
- color: "#f9ffa0"
- }
- GradientStop {
- position: 0.13
- color: "#f9ff99"
- }
- GradientStop {
- position: 0.14
- color: "#f3ff86"
- }
- GradientStop {
- position: 0.49
- color: "#93b353"
- }
- GradientStop {
- position: 0.87
- color: "#264619"
- }
- GradientStop {
- position: 0.96
- color: "#0c1306"
- }
- GradientStop {
- position: 1
- color: "#000000"
- }
- }
- fillColor: "blue" // ignored with the gradient set
+ id: p
+ strokeWidth: 5
+ strokeColor: "blue"
strokeStyle: ShapePath.DashLine
- dashPattern: [ 1, 4 ]
- startX: 20
- startY: 20
- PathLine {
- x: 180
- y: 130
- }
- PathLine {
- x: 20
- y: 130
+ dashPattern: [ 1, 4, 4, 4 ]
+ fillColor: "lightBlue"
+
+ property real xr: 70
+ property real yr: 30
+ startX: shape.width / 2 - xr
+ startY: shape.height / 2 - yr
+ PathArc {
+ x: shape.width / 2 + p.xr
+ y: shape.height / 2 + p.yr
+ radiusX: p.xr
+ radiusY: p.yr
+ useLargeArc: true
}
- PathLine {
- x: 20
- y: 20
+ PathArc {
+ x: shape.width / 2 - p.xr
+ y: shape.height / 2 - p.yr
+ radiusX: p.xr
+ radiusY: p.yr
+ useLargeArc: true
}
}
}
diff --git a/examples/quick/shapes/linearGradient.qml b/examples/quick/shapes/linearGradient.qml
index 742f8622e9..cb89be7e6b 100644
--- a/examples/quick/shapes/linearGradient.qml
+++ b/examples/quick/shapes/linearGradient.qml
@@ -9,34 +9,81 @@ Rectangle {
width: 256
height: 256
Shape {
- id: shape
- anchors.fill: parent
-
+ width: 200
+ height: 150
+ anchors.centerIn: parent
ShapePath {
- id: p
- strokeWidth: 5
- strokeColor: "blue"
+ strokeWidth: 4
+ strokeColor: "red"
+ fillGradient: LinearGradient {
+ x1: 20
+ y1: 20
+ x2: 180
+ y2: 130
+ GradientStop {
+ position: 0
+ color: "blue"
+ }
+ GradientStop {
+ position: 0.2
+ color: "green"
+ }
+ GradientStop {
+ position: 0.4
+ color: "red"
+ }
+ GradientStop {
+ position: 0.6
+ color: "yellow"
+ }
+ GradientStop {
+ position: 1
+ color: "cyan"
+ }
+ }
+ fillColor: "blue" // ignored with the gradient set
strokeStyle: ShapePath.DashLine
- dashPattern: [ 1, 4, 4, 4 ]
- fillColor: "lightBlue"
-
- property real xr: 70
- property real yr: 30
- startX: shape.width / 2 - xr
- startY: shape.height / 2 - yr
- PathArc {
- x: shape.width / 2 + p.xr
- y: shape.height / 2 + p.yr
- radiusX: p.xr
- radiusY: p.yr
- useLargeArc: true
+ dashPattern: [ 1, 4 ]
+ startX: 20
+ startY: 20
+ PathLine {
+ x: 180
+ y: 130
+ }
+ PathLine {
+ x: 20
+ y: 130
+ }
+ PathLine {
+ x: 20
+ y: 20
+ }
+ }
+ transform: Rotation {
+ origin.x: 100
+ origin.y: 50
+ axis {
+ x: 0
+ y: 1
+ z: 0
}
- PathArc {
- x: shape.width / 2 - p.xr
- y: shape.height / 2 - p.yr
- radiusX: p.xr
- radiusY: p.yr
- useLargeArc: true
+ SequentialAnimation on angle {
+ NumberAnimation {
+ from: 0
+ to: 75
+ duration: 2000
+ }
+ NumberAnimation {
+ from: 75
+ to: -75
+ duration: 4000
+ }
+ NumberAnimation {
+ from: -75
+ to: 0
+ duration: 2000
+ }
+ loops: Animation.Infinite
}
}
}
diff --git a/examples/quick/shapes/radialGradient.qml b/examples/quick/shapes/radialGradient.qml
index cb89be7e6b..87db319c9a 100644
--- a/examples/quick/shapes/radialGradient.qml
+++ b/examples/quick/shapes/radialGradient.qml
@@ -15,30 +15,80 @@ Rectangle {
ShapePath {
strokeWidth: 4
strokeColor: "red"
- fillGradient: LinearGradient {
- x1: 20
- y1: 20
- x2: 180
- y2: 130
+ fillGradient: RadialGradient {
+ centerX: 100
+ centerY: 100
+ centerRadius: 100
+ SequentialAnimation on focalRadius {
+ loops: Animation.Infinite
+ NumberAnimation {
+ from: 1
+ to: 20
+ duration: 2000
+ }
+ NumberAnimation {
+ from: 20
+ to: 1
+ duration: 2000
+ }
+ }
+ SequentialAnimation on focalX {
+ loops: Animation.Infinite
+ NumberAnimation {
+ from: 50
+ to: 150
+ duration: 3000
+ }
+ NumberAnimation {
+ from: 150
+ to: 50
+ duration: 3000
+ }
+ }
+ SequentialAnimation on focalY {
+ loops: Animation.Infinite
+ NumberAnimation {
+ from: 50
+ to: 150
+ duration: 1000
+ }
+ NumberAnimation {
+ from: 150
+ to: 50
+ duration: 1000
+ }
+ }
GradientStop {
position: 0
- color: "blue"
+ color: "#ffffff"
+ }
+ GradientStop {
+ position: 0.11
+ color: "#f9ffa0"
+ }
+ GradientStop {
+ position: 0.13
+ color: "#f9ff99"
}
GradientStop {
- position: 0.2
- color: "green"
+ position: 0.14
+ color: "#f3ff86"
}
GradientStop {
- position: 0.4
- color: "red"
+ position: 0.49
+ color: "#93b353"
}
GradientStop {
- position: 0.6
- color: "yellow"
+ position: 0.87
+ color: "#264619"
+ }
+ GradientStop {
+ position: 0.96
+ color: "#0c1306"
}
GradientStop {
position: 1
- color: "cyan"
+ color: "#000000"
}
}
fillColor: "blue" // ignored with the gradient set
@@ -59,32 +109,5 @@ Rectangle {
y: 20
}
}
- transform: Rotation {
- origin.x: 100
- origin.y: 50
- axis {
- x: 0
- y: 1
- z: 0
- }
- SequentialAnimation on angle {
- NumberAnimation {
- from: 0
- to: 75
- duration: 2000
- }
- NumberAnimation {
- from: 75
- to: -75
- duration: 4000
- }
- NumberAnimation {
- from: -75
- to: 0
- duration: 2000
- }
- loops: Animation.Infinite
- }
- }
}
}
diff --git a/examples/quick/shapes/shapegallery.qml b/examples/quick/shapes/shapegallery.qml
index b74c0b9631..74059b8208 100644
--- a/examples/quick/shapes/shapegallery.qml
+++ b/examples/quick/shapes/shapegallery.qml
@@ -88,15 +88,15 @@ Rectangle {
}
ListElement {
name: qsTr("Dash pattern")
- shapeUrl: "linearGradient.qml"
+ shapeUrl: "dashPattern.qml"
}
ListElement {
name: qsTr("Linear gradient")
- shapeUrl: "radialGradient.qml"
+ shapeUrl: "linearGradient.qml"
}
ListElement {
name: qsTr("Radial gradient")
- shapeUrl: "dashPattern.qml"
+ shapeUrl: "radialGradient.qml"
}
ListElement {
name: qsTr("Fill rules")