aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick/shapes
diff options
context:
space:
mode:
authorKaj Grönholm <kaj.gronholm@qt.io>2023-08-23 07:58:39 +0300
committerKaj Grönholm <kaj.gronholm@qt.io>2023-08-23 13:31:07 +0300
commiteb6af63f6105d207458dc38ee42b6ecb5fc641cd (patch)
tree23853269a704dfa003a6531dee27fd3068ace29e /examples/quick/shapes
parent6bab3e5c76f9322a8183746fa8836c85d882d931 (diff)
Add CurveRenderer item into shape antialiasing example
CurveRenderer has built-in antialiasing supports, so compare it here to MSAA and SSAA. Task-number: QTBUG-104122 Pick-to: 6.6 Change-Id: I207ab770cae052b195e9da8802dc594a91ce713b Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Diffstat (limited to 'examples/quick/shapes')
-rw-r--r--examples/quick/shapes/main.qml2
-rw-r--r--examples/quick/shapes/sampling.qml50
2 files changed, 51 insertions, 1 deletions
diff --git a/examples/quick/shapes/main.qml b/examples/quick/shapes/main.qml
index 90fcbd28f0..7dc644be1d 100644
--- a/examples/quick/shapes/main.qml
+++ b/examples/quick/shapes/main.qml
@@ -12,7 +12,7 @@ Item {
Component.onCompleted: {
addExample(qsTr("Shape Gallery"), qsTr("Simple path rendering examples"), Qt.resolvedUrl("shapegallery.qml"))
addExample(qsTr("Interactive Shape"), qsTr("Dynamic, interactive path rendering examples"), Qt.resolvedUrl("interactive.qml"))
- addExample(qsTr("Super- and multisampling"), qsTr("Improving quality"), Qt.resolvedUrl("sampling.qml"))
+ addExample(qsTr("Anti-aliasing"), qsTr("Improving quality"), Qt.resolvedUrl("sampling.qml"))
addExample(qsTr("Clip My Tiger!"), qsTr("Clip examples, a.k.a. What Not To Do"), Qt.resolvedUrl("clippedtigers.qml"))
}
}
diff --git a/examples/quick/shapes/sampling.qml b/examples/quick/shapes/sampling.qml
index f58815e813..27515b6722 100644
--- a/examples/quick/shapes/sampling.qml
+++ b/examples/quick/shapes/sampling.qml
@@ -202,6 +202,56 @@ Rectangle {
}
}
}
+ Text {
+ text: qsTr("CurveRenderer")
+ }
+
+ // Now let's use CurveRenderer with built-in antialiasing support.
+ Rectangle {
+ color: "lightGray"
+ width: 400
+ height: 200
+
+ Shape {
+ x: 30
+ y: 20
+ width: 50
+ height: 50
+ scale: 2
+ preferredRendererType: Shape.CurveRenderer
+ antialiasing: true
+
+ ShapePath {
+ strokeColor: "green"
+ NumberAnimation on strokeWidth {
+ from: 1
+ to: 20
+ duration: 5000
+ }
+ fillColor: "transparent"
+ capStyle: ShapePath.RoundCap
+
+ startX: 40
+ startY: 30
+ PathQuad {
+ x: 50
+ y: 80
+ controlX: 0
+ controlY: 80
+ }
+ PathLine {
+ x: 150
+ y: 80
+ }
+ PathQuad {
+ x: 160
+ y: 30
+ controlX: 200
+ controlY: 80
+ }
+ }
+ }
+ }
}
}
}