diff options
author | Leena Miettinen <riitta-leena.miettinen@qt.io> | 2016-06-08 11:51:59 +0200 |
---|---|---|
committer | Jani Heikkinen <jani.heikkinen@qt.io> | 2016-06-09 19:23:41 +0000 |
commit | abe26ee695fbcb2b896064b1b00e00392bce8c66 (patch) | |
tree | aaa1cf519047bec2fcd62c138d009bf7390639ab /examples/qt3d/simple-cpp | |
parent | dc56491ab6c60cd2fc0cab4514e3da444f255859 (diff) |
Doc: Add documentation for the Simple C++ example
Without this change Qt Creator tags this example "broken"
and hides it from the Examples tab in the Welcome mode.
Change-Id: I276ddb3ea50f05695a6afa7fa34de682bdc944c2
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'examples/qt3d/simple-cpp')
-rw-r--r-- | examples/qt3d/simple-cpp/doc/images/simple-cpp.png | bin | 0 -> 12385 bytes | |||
-rw-r--r-- | examples/qt3d/simple-cpp/doc/src/simple-cpp.qdoc | 49 |
2 files changed, 49 insertions, 0 deletions
diff --git a/examples/qt3d/simple-cpp/doc/images/simple-cpp.png b/examples/qt3d/simple-cpp/doc/images/simple-cpp.png Binary files differnew file mode 100644 index 000000000..811f8b5df --- /dev/null +++ b/examples/qt3d/simple-cpp/doc/images/simple-cpp.png diff --git a/examples/qt3d/simple-cpp/doc/src/simple-cpp.qdoc b/examples/qt3d/simple-cpp/doc/src/simple-cpp.qdoc index 78a8a6dd4..be8a375a4 100644 --- a/examples/qt3d/simple-cpp/doc/src/simple-cpp.qdoc +++ b/examples/qt3d/simple-cpp/doc/src/simple-cpp.qdoc @@ -29,4 +29,53 @@ \example simple-cpp \title Qt 3D: Simple C++ Example \ingroup qt3d-examples-cpp + \brief A C++ application that demonstrates how to render a scene in Qt 3D. + + \image simple-cpp.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 scene in the \e main.cpp file. + + To be able to use the classes and functions in the Q3D Core, Q3D Render, + Qt 3D Input, and Qt 3D Extras modules, we must include the classes: + + \quotefromfile simple-cpp/main.cpp + \skipto Qt3DCore + \printuntil QTorusMesh + + First, we set up the scene and specify its root entity: + + \skipto createScene() + \printuntil { + \skipto rootEntity + \printuntil ; + + We specify the material to use for Phong rendering: + + \skipto QPhongMaterial + \printuntil ; + + The root entity is just an empty shell and its behavior is defined by the + components that it references. We specify the torus entity and its mesh, + transform, and material components: + + \skipto torusEntity + \printuntil material + + We also specify a sphere entity and its components: + + \skipto sphereEntity + \printuntil material + + We use a property animation to animate the sphere transform. + + Finally, we initialize a Qt GUI application that uses a Qt 3D window: + + \skipto int + \printuntil } */ |