aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaj Grönholm <kaj.gronholm@qt.io>2023-08-23 07:58:39 +0300
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2023-08-23 14:43:31 +0000
commitaca17e6775a9324a1f63e866df2bc647226caf1d (patch)
tree6c4097eb6c3e09536c278dac26f446b33a2a722e
parent91f0cd03e52c5a89361c75c9aaa9530919476b79 (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 Change-Id: I207ab770cae052b195e9da8802dc594a91ce713b Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> (cherry picked from commit eb6af63f6105d207458dc38ee42b6ecb5fc641cd) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-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
+ }
+ }
+ }
+ }
}
}
}