summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAndreas Eliasson <andreas.eliasson@qt.io>2023-02-16 14:32:39 +0100
committerAndreas Eliasson <andreas.eliasson@qt.io>2023-03-06 12:12:02 +0100
commit5859a840c3f21b36d4c7849c173c38e16ef52fd2 (patch)
treed4fcc629158c183fc2bdd18dfa211936c0fec23e /tests
parent6c1155f6ac4e8baa554a55b915eca0add4030d07 (diff)
downloadqt3d-5859a840c3f21b36d4c7849c173c38e16ef52fd2.tar.gz
Doc: Replace \quotefromfile with \snippet to make code left-aligned
The \quotefromfile command is smart enough to keep the left indentation from the source file when it renders the code in a code snippet in a qdoc file. This is all good when you're listing multiple code snippets and you can clearly see the left-most-aligned code, or 'starting point'. However, when you use \quotefromfile for a single code snippet that is indented in the source file, the rendered code in the qdoc file is not left-aligned - and this looks a bit odd. Pick-to: 6.5 6.4 6.2 Change-Id: Ie6d2445b37faa4a75749d6013001892de012a1ef Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/manual/scene3d/AnimatedEntity.qml3
-rw-r--r--tests/manual/scene3d/doc/src/scene3d.qdoc9
-rw-r--r--tests/manual/scene3d/main.qml3
3 files changed, 6 insertions, 9 deletions
diff --git a/tests/manual/scene3d/AnimatedEntity.qml b/tests/manual/scene3d/AnimatedEntity.qml
index 65ebd27b1..a23060e4d 100644
--- a/tests/manual/scene3d/AnimatedEntity.qml
+++ b/tests/manual/scene3d/AnimatedEntity.qml
@@ -16,7 +16,7 @@ Entity {
property bool validBounds: sphereMesh.implicitPointsValid
property vector3d sphereMinPt: sphereMesh.implicitMinPoint
property vector3d sphereMaxPt: sphereMesh.implicitMaxPoint
-
+ //! [0]
Camera {
id: camera
projectionType: CameraLens.PerspectiveProjection
@@ -27,6 +27,7 @@ Entity {
upVector: Qt.vector3d( 0.0, 1.0, 0.0 )
viewCenter: Qt.vector3d( 0.0, 0.0, 0.0 )
}
+ //! [0]
FirstPersonCameraController { camera: camera }
diff --git a/tests/manual/scene3d/doc/src/scene3d.qdoc b/tests/manual/scene3d/doc/src/scene3d.qdoc
index 27293551d..bf33b28cb 100644
--- a/tests/manual/scene3d/doc/src/scene3d.qdoc
+++ b/tests/manual/scene3d/doc/src/scene3d.qdoc
@@ -19,14 +19,9 @@
We set up the 3D scene and specify the entity to animate in \e main.qml:
- \quotefromfile scene3d/main.qml
- \skipto Scene3D {
- \printuntil }
- \printuntil }
+ \snippet scene3d/main.qml 0
We specify the active camera in \e scene3d/AnimatedEntity.qml:
- \quotefromfile scene3d/AnimatedEntity.qml
- \skipto Camera
- \printuntil }
+ \snippet scene3d/AnimatedEntity.qml 0
*/
diff --git a/tests/manual/scene3d/main.qml b/tests/manual/scene3d/main.qml
index 998c7a275..9e8531000 100644
--- a/tests/manual/scene3d/main.qml
+++ b/tests/manual/scene3d/main.qml
@@ -44,7 +44,7 @@ Item {
origin.x: scene.width / 2
origin.y: scene.height / 2
}
-
+ //! [0]
Scene3D {
id: scene3d
anchors.fill: parent
@@ -57,6 +57,7 @@ Item {
id: rootEntity
}
}
+ //! [0]
}
Rectangle {