summaryrefslogtreecommitdiffstats
path: root/examples/surface/doc
diff options
context:
space:
mode:
authorMika Salmela <mika.salmela@digia.com>2013-10-11 14:08:27 +0300
committerMika Salmela <mika.salmela@digia.com>2013-10-11 14:13:03 +0300
commit34c345b024be424873bbb8b3c83414eea2bc7523 (patch)
treedcf946045d4002e082c3a2f291590b987c00506a /examples/surface/doc
parent4038e5eb11b585806fd63fa4fdb74be1d0f62a4b (diff)
Add application creation chapter to surface example.
Change-Id: Ia787f1ebd5b5d9e781f1d95c4747045e6d2e4a94 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
Diffstat (limited to 'examples/surface/doc')
-rw-r--r--examples/surface/doc/src/surface.qdoc23
1 files changed, 22 insertions, 1 deletions
diff --git a/examples/surface/doc/src/surface.qdoc b/examples/surface/doc/src/surface.qdoc
index 4a0ce794..12271fb8 100644
--- a/examples/surface/doc/src/surface.qdoc
+++ b/examples/surface/doc/src/surface.qdoc
@@ -36,7 +36,28 @@
\endlist
\image surface-example.png
- \section1 Setting up proxies and setting the data
+ \section1 Creating the application
+
+ First, in \c main.cpp, we create a QApplication, instantiate Q3DSurface and a window container
+ for it:
+
+ \snippet ../examples/surface/main.cpp 0
+
+ The call to QWidget::createWindowContainer is required, as all data visualization types
+ (Q3DBars, Q3DScatter, Q3DSurface) inherit QWindow. Any class inheriting QWindow cannot be used
+ as a widget any other way.
+
+ Then we'll create horizontal and vertical layouts. We'll add the graph with the container and
+ the vertical layout into the horizontal one:
+
+ \snippet ../examples/surface/main.cpp 1
+
+ The rest of the code in \c main.cpp is creating control widgets for features in Q3DSurface. We
+ have separated code for changing these features into \c surfacegraph.cpp and only connect
+ signals from widgets into methods in \c surfacegraph.cpp. Next chapter explains more
+ about using Q3DSurface.
+
+ \section1 Setting up proxies and data
First we instantiate a new QSurfaceDataProxy: