From dc56491ab6c60cd2fc0cab4514e3da444f255859 Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Wed, 8 Jun 2016 12:35:05 +0200 Subject: Doc: Add documentation for the Simple QML example Without this change Qt Creator tags this example "broken" and hides it from the Examples tab in the Welcome mode. Change-Id: I4f0faa6b18c3f1ec2de673e3f6ced7e23b46c094 Reviewed-by: Paul Lemire --- examples/qt3d/simple-qml/doc/images/simple-qml.png | Bin 0 -> 17485 bytes examples/qt3d/simple-qml/doc/src/simple-qml.qdoc | 52 +++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 examples/qt3d/simple-qml/doc/images/simple-qml.png (limited to 'examples') diff --git a/examples/qt3d/simple-qml/doc/images/simple-qml.png b/examples/qt3d/simple-qml/doc/images/simple-qml.png new file mode 100644 index 000000000..a0a349025 Binary files /dev/null and b/examples/qt3d/simple-qml/doc/images/simple-qml.png differ diff --git a/examples/qt3d/simple-qml/doc/src/simple-qml.qdoc b/examples/qt3d/simple-qml/doc/src/simple-qml.qdoc index 36bb5497e..13ca8ff1f 100644 --- a/examples/qt3d/simple-qml/doc/src/simple-qml.qdoc +++ b/examples/qt3d/simple-qml/doc/src/simple-qml.qdoc @@ -29,4 +29,56 @@ \example simple-qml \title Qt 3D: Simple QML Example \ingroup qt3d-examples-qml + \brief A QML application that demonstrates how to render a scene in Qt 3D. + + \image simple-qml.png + + \e {Simple} demonstrates how to render a scene in Qt 3D. + + \include examples-run.qdocinc + + \section1 Setting Up the Scene + + We set up the entire scene in the \e main.qml file. + + To be able to use the types in the Q3D and Q3D Render modules, we must + import the modules: + + \quotefromfile simple-qml/main.qml + \skipto import Qt3D.Core + \printuntil Render 2.0 + + The first entities we create are a \l Camera, which represents the camera + used for the final rendering, and a camera controller, which allows us to + control this camera using the keyboard or the mouse: + + \skipto Camera { + \printuntil } + \printuntil } + + A \l RenderSettings entity specifies a ForwardRenderer as the active + framegraph: + + \printuntil }, + + The event source is set by the Qt3DQuickWindow: + + \skipto InputSettings + \printuntil } + + \section1 + + \section1 Specifying Settings and Axes + + In the \e CameraController.qml file, we use the LogicalDevice type to define + a set of actions and axes to use within the application: + + \quotefromfile simple-qml/CameraController.qml + \skipto LogicalDevice { + \printuntil ] + \dots + \skipto axes + \printuntil ] + \dots + \skipto /^\}/ */ -- cgit v1.2.3