diff options
author | Oliver Eftevaag <oliver.eftevaag@qt.io> | 2023-02-20 18:01:12 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2023-03-02 19:31:19 +0000 |
commit | 8211d538d1afa17be6530c4fdf9ba38f4bea4481 (patch) | |
tree | 67f68524483980ffaa380b30e8bdd7b06d81c1f7 /examples/quick/canvas/canvas.qml | |
parent | 9947c9d2a9a1eb64d74bf0228bf0a164c3522782 (diff) |
Canvas example: Improve usage of best practices
This commit updates the example in order to adopt as many best
practices and follow our coding conventions from our official
documentation.
- qmllint will report no erros with this patch (As long as the shared
module is imported).
- strings are translated.
- JS statements no longer end with semi-colon.
- Removed unused properties and marked those that are only read as
readonly
Change-Id: Ibe0d0750d48018b618a5cf8c3bcecb7e29488274
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit 12e4871465a7552bb722733298a6c796b9fa4b30)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'examples/quick/canvas/canvas.qml')
-rw-r--r-- | examples/quick/canvas/canvas.qml | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/examples/quick/canvas/canvas.qml b/examples/quick/canvas/canvas.qml index 114941bbdc..6ac856eb6d 100644 --- a/examples/quick/canvas/canvas.qml +++ b/examples/quick/canvas/canvas.qml @@ -5,19 +5,26 @@ import QtQuick import shared as Examples Item { + id: root height: 480 width: 320 Examples.LauncherList { - id: ll - anchors.fill: parent + anchors.fill: root Component.onCompleted: { - addExample("Red heart", "Draws a red heart with bezier curves", Qt.resolvedUrl("bezierCurve/bezierCurve.qml")); - addExample("Talk bubble", "Draws a talk bubble with quadratic curves", Qt.resolvedUrl("quadraticCurveTo/quadraticCurveTo.qml")); - addExample("Squircle", "Draws a smooth squircle with simple lines", Qt.resolvedUrl("squircle/squircle.qml")); - addExample("Rounded rectangle", "Draws a rounded rectangle with lines and arcs", Qt.resolvedUrl("roundedrect/roundedrect.qml")); - addExample("Smile face", "Draws a smile face with complex paths", Qt.resolvedUrl("smile/smile.qml")); - addExample("Clip", "Shows the canvas clip feature", Qt.resolvedUrl("clip/clip.qml")); - addExample("Tiger", "Draw a tiger with a collection of SVG paths", Qt.resolvedUrl("tiger/tiger.qml")); + addExample(qsTr("Red heart"), qsTr("Draws a red heart with bezier curves"), + Qt.resolvedUrl("bezierCurve/bezierCurve.qml")) + addExample(qsTr("Talk bubble"), qsTr("Draws a talk bubble with quadratic curves"), + Qt.resolvedUrl("quadraticCurveTo/quadraticCurveTo.qml")) + addExample(qsTr("Squircle"), qsTr("Draws a smooth squircle with simple lines"), + Qt.resolvedUrl("squircle/squircle.qml")) + addExample(qsTr("Rounded rectangle"), qsTr("Draws a rounded rectangle with lines and arcs"), + Qt.resolvedUrl("roundedrect/roundedrect.qml")) + addExample(qsTr("Smile face"), qsTr("Draws a smile face with complex paths"), + Qt.resolvedUrl("smile/smile.qml")) + addExample(qsTr("Clip"), qsTr("Shows the canvas clip feature"), + Qt.resolvedUrl("clip/clip.qml")) + addExample(qsTr("Tiger"), qsTr("Draw a tiger with a collection of SVG paths"), + Qt.resolvedUrl("tiger/tiger.qml")) } } } |