aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/doc/snippets
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2025-04-01 15:58:58 +0200
committerShawn Rutledge <shawn.rutledge@qt.io>2025-04-02 00:12:13 +0200
commit36843b1bf7a12f9a54b6e484722c6bafb88df9e9 (patch)
tree8150dc78b307b73c73b2f8a22a9b16c301a1166b /src/quick/doc/snippets
parentbaf16a7ef69e4fdba75bd47e4ccb2ae7e8759eb8 (diff)
doc: Make transform snippets runnable
It's not clear at this point where qt.png was supposed to come from, but the modern Qt logo seems to work well enough. In the case of Item with two transforms, perhaps this was not tested before; that's the trouble with inline qml code. It's a little easier to visualize the effect with an Image of which you can see more than one edge (although parts of it remain hidden now too). Pick-to: 6.9 6.8 Change-Id: I64c685d4dc9568080b0ddb4921d987b07eb17c41 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Diffstat (limited to 'src/quick/doc/snippets')
-rw-r--r--src/quick/doc/snippets/qml/rotation.qml10
-rw-r--r--src/quick/doc/snippets/qml/two-transforms.qml13
2 files changed, 18 insertions, 5 deletions
diff --git a/src/quick/doc/snippets/qml/rotation.qml b/src/quick/doc/snippets/qml/rotation.qml
index 55a6d54cbb..8160bbe4b5 100644
--- a/src/quick/doc/snippets/qml/rotation.qml
+++ b/src/quick/doc/snippets/qml/rotation.qml
@@ -7,21 +7,21 @@ Row {
x: 10; y: 10
spacing: 10
- Image { source: "pics/qt.png" }
+ Image { source: "images/qt-logo.png" }
Image {
- source: "pics/qt.png"
+ source: "images/qt-logo.png"
transform: Rotation { origin.x: 30; origin.y: 30; axis { x: 0; y: 1; z: 0 } angle: 18 }
}
Image {
- source: "pics/qt.png"
+ source: "images/qt-logo.png"
transform: Rotation { origin.x: 30; origin.y: 30; axis { x: 0; y: 1; z: 0 } angle: 36 }
}
Image {
- source: "pics/qt.png"
+ source: "images/qt-logo.png"
transform: Rotation { origin.x: 30; origin.y: 30; axis { x: 0; y: 1; z: 0 } angle: 54 }
}
Image {
- source: "pics/qt.png"
+ source: "images/qt-logo.png"
transform: Rotation { origin.x: 30; origin.y: 30; axis { x: 0; y: 1; z: 0 } angle: 72 }
}
}
diff --git a/src/quick/doc/snippets/qml/two-transforms.qml b/src/quick/doc/snippets/qml/two-transforms.qml
new file mode 100644
index 0000000000..2224bb6ff2
--- /dev/null
+++ b/src/quick/doc/snippets/qml/two-transforms.qml
@@ -0,0 +1,13 @@
+// Copyright (C) 2025 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+//! [entire]
+import QtQuick
+
+Image {
+ source: "images/qt-logo.png"
+ transform: [
+ Scale { origin.x: 25; origin.y: 25; xScale: 1.25 },
+ Rotation { origin.x: 45; origin.y: 55; angle: 45 }
+ ]
+}
+//! [entire]