summaryrefslogtreecommitdiffstats
path: root/examples/datavisualization/bars/doc/src/bars.qdoc
diff options
context:
space:
mode:
Diffstat (limited to 'examples/datavisualization/bars/doc/src/bars.qdoc')
-rw-r--r--examples/datavisualization/bars/doc/src/bars.qdoc36
1 files changed, 18 insertions, 18 deletions
diff --git a/examples/datavisualization/bars/doc/src/bars.qdoc b/examples/datavisualization/bars/doc/src/bars.qdoc
index 3cfc72b1..58f6bdc4 100644
--- a/examples/datavisualization/bars/doc/src/bars.qdoc
+++ b/examples/datavisualization/bars/doc/src/bars.qdoc
@@ -42,7 +42,7 @@
First, in main.cpp, we create a QApplication, instantiate Q3DBars and a window container
for it:
- \snippet ../examples/bars/main.cpp 0
+ \snippet bars/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
@@ -51,7 +51,7 @@
Then we'll create horizontal and vertical layouts. We'll add the graph and the vertical
layout into the horizontal one:
- \snippet ../examples/bars/main.cpp 1
+ \snippet bars/main.cpp 1
We're not using the vertical layout for anything yet, but we'll get back to it in
\l {Using widgets to control the graph}
@@ -60,51 +60,51 @@
graph. Let's call it \c GraphModifier (See \l {Setting up the graph} and
\l {Adding data to the graph} for details):
- \snippet ../examples/bars/main.cpp 2
+ \snippet bars/main.cpp 2
The application main is done and we can show the graph and start the event loop:
- \snippet ../examples/bars/main.cpp 3
+ \snippet bars/main.cpp 3
\section1 Setting up the graph
Let's set up the graph in the constructor of the \c GraphModifier class we instantiated in the
application main:
- \snippet ../examples/bars/graphmodifier.cpp 0
+ \snippet bars/graphmodifier.cpp 0
Let's take a closer look at parts of the code.
First we're creating the axes and the series into member variables to support changing them
easily later on, if we want to:
- \snippet ../examples/bars/graphmodifier.cpp 1
+ \snippet bars/graphmodifier.cpp 1
Then we're setting some of the visual qualities for the graph:
- \snippet ../examples/bars/graphmodifier.cpp 2
+ \snippet bars/graphmodifier.cpp 2
We're also setting up the axes and setting them to the graph as active axes:
- \snippet ../examples/bars/graphmodifier.cpp 3
+ \snippet bars/graphmodifier.cpp 3
Next we initialize the visual properties of the series.
Note that the second series is initially not visible:
- \snippet ../examples/bars/graphmodifier.cpp 8
+ \snippet bars/graphmodifier.cpp 8
The series need to be added to the graph to show them:
- \snippet ../examples/bars/graphmodifier.cpp 4
+ \snippet bars/graphmodifier.cpp 4
Finally, we set the camera angle by calling the same method the camera angle change button
in the UI uses to cycle through various camera angles:
- \snippet ../examples/bars/graphmodifier.cpp 6
+ \snippet bars/graphmodifier.cpp 6
There you can see that the camera is controlled via the scene object of the graph:
- \snippet ../examples/bars/graphmodifier.cpp 10
+ \snippet bars/graphmodifier.cpp 10
For more information about using scene and cameras, see Q3DScene and Q3DCamera.
@@ -114,11 +114,11 @@
At the end of the constructor there's a call:
- \snippet ../examples/bars/graphmodifier.cpp 9
+ \snippet bars/graphmodifier.cpp 9
This method is used to add data to the proxies of the two series:
- \snippet ../examples/bars/graphmodifier.cpp 5
+ \snippet bars/graphmodifier.cpp 5
Now the series have data to show.
@@ -127,24 +127,24 @@
There isn't much interaction yet, so let's continue by adding some widgets back in the
application main. Let's just focus on two as an example:
- \snippet ../examples/bars/main.cpp 4
+ \snippet bars/main.cpp 4
We can use these slider widgets to rotate the graph instead of just using the mouse or
touch.
Let's add them to the vertical layout we created earlier:
- \snippet ../examples/bars/main.cpp 5
+ \snippet bars/main.cpp 5
Then we'll connect them to methods in \c GraphModifier:
- \snippet ../examples/bars/main.cpp 6
+ \snippet bars/main.cpp 6
Here are the methods in \c GraphModifier the signals were connected to. The camera
is controlled via the scene object. This time we specify the actual camera position
along the orbit around the center point, instead of specifying a preset camera angle:
- \snippet ../examples/bars/graphmodifier.cpp 7
+ \snippet bars/graphmodifier.cpp 7
Now these two sliders can be used to rotate the graph.