aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick
diff options
context:
space:
mode:
authorAndreas Eliasson <andreas.eliasson@qt.io>2023-11-16 12:06:46 +0100
committerAndreas Eliasson <andreas.eliasson@qt.io>2023-12-01 09:24:46 +0000
commit39793d56e004279d81c6a1191bb7b24c83ae0b8a (patch)
tree6e128cc89e1b54a731dd6d070e88935d973ab33d /examples/quick
parent402514816741a221b2b0e8d483a3dd389c224431 (diff)
Doc: Add CMake section to Scene Graph example
The current page only mentions qmake. Let's add a CMake section. Also, make minor grammatical fixes. Fixes: QTBUG-118802 Pick-to: 6.6 6.5 Change-Id: I311084c72f609a72ef5716964cd6c7c28fa64208 Reviewed-by: Andreas Eliasson <andreas.eliasson@qt.io>
Diffstat (limited to 'examples/quick')
-rw-r--r--examples/quick/scenegraph/customgeometry/doc/src/customgeometry.qdoc33
1 files changed, 25 insertions, 8 deletions
diff --git a/examples/quick/scenegraph/customgeometry/doc/src/customgeometry.qdoc b/examples/quick/scenegraph/customgeometry/doc/src/customgeometry.qdoc
index 2d4ce46fe7..09f3f3a9fc 100644
--- a/examples/quick/scenegraph/customgeometry/doc/src/customgeometry.qdoc
+++ b/examples/quick/scenegraph/customgeometry/doc/src/customgeometry.qdoc
@@ -8,9 +8,9 @@
\ingroup qtquickexamples
\brief Shows how to implement a custom geometry in the Qt Quick Scene Graph.
- The custom geometry example shows how to create a QQuickItem which
+ The custom geometry example shows how to create a \l QQuickItem that
uses the scene graph API to build a custom geometry for the scene
- graph. It does this by creating a BezierCurve item which is made
+ graph. It does this by creating a \c BezierCurve item, which is made
part of the CustomGeometry module and makes use of this in a QML
file.
@@ -115,7 +115,7 @@
\snippet scenegraph/customgeometry/beziercurve.cpp 6
The scene graph API provides a few commonly used material
- implementations. In this example we use the QSGFlatColorMaterial
+ implementations. In this example we use the QSGFlatColorMaterial,
which will fill the shape defined by the geometry with a solid
color. Again we pass the ownership of the material to the node, so
it can be cleaned up by the scene graph.
@@ -130,7 +130,7 @@
\snippet scenegraph/customgeometry/beziercurve.cpp 8
- To fill the geometry, we first extract the vertex array from
+ To fill the geometry we first extract the vertex array from
it. Since we are using one of the default attribute sets, we can
use the convenience function QSGGeometry::vertexDataAsPoint2D().
Then we go through each segment and calculate its position and
@@ -138,7 +138,7 @@
\snippet scenegraph/customgeometry/beziercurve.cpp 9
- In the end of the function, we return the node so the scene graph
+ At the end of the function we return the node so the scene graph
can render it.
\section1 Application Entry-Point
@@ -153,9 +153,26 @@
To make use of the BezierCurve item, we need to register it in the QML
engine, using the QML_ELEMENT macro. This gives it the name
BezierCurve and makes it part of the \c {CustomGeometry 1.0}
- module as defined in the customgeometry.pro file:
-
- \quotefile scenegraph/customgeometry/customgeometry.pro
+ module as defined in the project's build files:
+
+ \if defined(onlinedocs)
+ \tab {build-qt-app}{tab-cmake}{CMake}{checked}
+ \tab {build-qt-app}{tab-qmake}{qmake}{}
+ \tabcontent {tab-cmake}
+ \else
+ \section1 Using CMake
+ \endif
+ \quotefile scenegraph/customgeometry/CMakeLists.txt
+ \if defined(onlinedocs)
+ \endtabcontent
+ \tabcontent {tab-qmake}
+ \else
+ \section1 Using qmake
+ \endif
+ \quotefile scenegraph/customgeometry/customgeometry.pro
+ \if defined(onlinedocs)
+ \endtabcontent
+ \endif
As the bezier curve is drawn as line strips, we specify that
the view should be multisampled to get antialiasing. This is not