summaryrefslogtreecommitdiffstats
path: root/examples/datavisualization
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@digia.com>2014-02-13 12:52:37 +0200
committerMiikka Heikkinen <miikka.heikkinen@digia.com>2014-02-13 13:01:25 +0200
commitb13cc1e98241cb729787743ad2e448fea5470c49 (patch)
tree203a86842fb42089dc405ed12e7fcd4c081ab036 /examples/datavisualization
parent1549721eb6334752b71327e58f55ba014577f3b5 (diff)
Fix docs build after recent reordering of examples
Change-Id: I6aef7c7f0857606a035f1302000408cb7d4a11c1 Reviewed-by: Tomi Korpipää <tomi.korpipaa@digia.com>
Diffstat (limited to 'examples/datavisualization')
-rw-r--r--examples/datavisualization/audiolevels/doc/src/audiolevels.qdoc12
-rw-r--r--examples/datavisualization/bars/doc/src/bars.qdoc36
-rw-r--r--examples/datavisualization/custominput/doc/src/custominput.qdoc12
-rw-r--r--examples/datavisualization/customproxy/doc/src/customproxy.qdoc22
-rw-r--r--examples/datavisualization/itemmodel/doc/src/itemmodel.qdoc34
-rw-r--r--examples/datavisualization/qmlbars/doc/src/qmlbars.qdoc14
-rw-r--r--examples/datavisualization/qmlcustominput/doc/src/qmlcustominput.qdoc16
-rw-r--r--examples/datavisualization/qmllegend/doc/src/qmllegend.qdoc12
-rw-r--r--examples/datavisualization/qmlmultigraph/doc/src/qmlmultigraph.qdoc2
-rw-r--r--examples/datavisualization/qmloscilloscope/doc/src/qmloscilloscope.qdoc20
-rw-r--r--examples/datavisualization/qmlscatter/doc/src/qmlscatter.qdoc38
-rw-r--r--examples/datavisualization/qmlsurface/doc/src/qmlsurface.qdoc20
-rw-r--r--examples/datavisualization/qmlsurfacelayers/doc/src/qmlsurfacelayers.qdoc14
-rw-r--r--examples/datavisualization/rotations/doc/src/rotations.qdoc10
-rw-r--r--examples/datavisualization/scatter/doc/src/scatter.qdoc30
-rw-r--r--examples/datavisualization/surface/doc/src/surface.qdoc24
16 files changed, 158 insertions, 158 deletions
diff --git a/examples/datavisualization/audiolevels/doc/src/audiolevels.qdoc b/examples/datavisualization/audiolevels/doc/src/audiolevels.qdoc
index ad87ecc0..11bea3c3 100644
--- a/examples/datavisualization/audiolevels/doc/src/audiolevels.qdoc
+++ b/examples/datavisualization/audiolevels/doc/src/audiolevels.qdoc
@@ -39,23 +39,23 @@
In the header file for \c AudioLevels class we declare necessary members:
- \snippet ../examples/audiolevels/audiolevels.h 0
+ \snippet audiolevels/audiolevels.h 0
And initialize the microphone listening in the source:
- \snippet ../examples/audiolevels/audiolevels.cpp 0
+ \snippet audiolevels/audiolevels.cpp 0
In the header file for \c AudioLevelsIODevice class we store pointers to the data proxy and
also the data array we give to the proxy, because we reuse the same array to keep memory
reallocations to the minimum:
- \snippet ../examples/audiolevels/audiolevelsiodevice.h 0
+ \snippet audiolevels/audiolevelsiodevice.h 0
In the source file we define some static constants to define size of the data array and
the middle row index, as well as the resolution of the visualization. You may need to adjust
these values to get decent performance in low-end devices:
- \snippet ../examples/audiolevels/audiolevelsiodevice.cpp 1
+ \snippet audiolevels/audiolevelsiodevice.cpp 1
The \c resolution constant indicates the sample rate, for example, value 8 means every eighth
byte from audio input is visualized. This is necessary to make the data readable, as it would
@@ -63,13 +63,13 @@
In the \c AudioLevelsIODevice class constructor we initialize the data array:
- \snippet ../examples/audiolevels/audiolevelsiodevice.cpp 0
+ \snippet audiolevels/audiolevelsiodevice.cpp 0
The \c AudioLevelsIODevice::writeData function is called whenever there is new audio data
available to be visualized. There we move the old data along the rows and insert new
data in the beginning of the rows:
- \snippet ../examples/audiolevels/audiolevelsiodevice.cpp 2
+ \snippet audiolevels/audiolevelsiodevice.cpp 2
We use a couple of techniques here to improve performance. First, we reuse
the existing data array, as this allows us to avoid any extra memory allocations in our
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.
diff --git a/examples/datavisualization/custominput/doc/src/custominput.qdoc b/examples/datavisualization/custominput/doc/src/custominput.qdoc
index 88c53b4d..59d3c090 100644
--- a/examples/datavisualization/custominput/doc/src/custominput.qdoc
+++ b/examples/datavisualization/custominput/doc/src/custominput.qdoc
@@ -34,19 +34,19 @@
The default input handling mechanism is replaced by setting the active input handler of \l Q3DScatter
to \c CustomInputHandler that implements the custom behavior.
- \snippet ../examples/custominput/scatterdatamodifier.cpp 0
+ \snippet custominput/scatterdatamodifier.cpp 0
\section1 Implementing custom selection handling
The on mouseover selection handling is implemented in the \c CustomInputHandler that captures the mouse events.
It then stores the last known coordinates to the \l QAbstract3DInputHandler::inputPosition property.
- \snippet ../examples/custominput/custominputhandler.cpp 0
+ \snippet custominput/custominputhandler.cpp 0
As the selection is one shot, and is cleared each time a 3D frame is rendered, a timer is setup to retrigger selection so that the selection moves to the item
currently under the mouse cursor as the camera animates around the graph even when the mouse cursor is not moving.
- \snippet ../examples/custominput/scatterdatamodifier.cpp 1
+ \snippet custominput/scatterdatamodifier.cpp 1
\section1 Implementing custom zoom handling
@@ -54,17 +54,17 @@
between 10% and 500%. This range is then divided to four subranges where \c angleDelta is scaled to different amount of zoom change
based on the current subrange.
- \snippet ../examples/custominput/custominputhandler.cpp 1
+ \snippet custominput/custominputhandler.cpp 1
\section1 Implementing custom camera handling
The camera is animated to constantly rotate around the graph with two animations. The rotation around the graph is done with
a simple QPropertyAnimation that just increments during 20 seconds from 0 degrees to 360 degrees and sets the \l Q3DCamera::xRotation property.
- \snippet ../examples/custominput/scatterdatamodifier.cpp 2
+ \snippet custominput/scatterdatamodifier.cpp 2
The camera movement up and down is implemented with a QSequentialAnimationGroup that varies the \l Q3DCamera::yRotation property of the camera
from 5 degrees to 45 degrees and back with in and out easing.
- \snippet ../examples/custominput/scatterdatamodifier.cpp 3
+ \snippet custominput/scatterdatamodifier.cpp 3
*/
diff --git a/examples/datavisualization/customproxy/doc/src/customproxy.qdoc b/examples/datavisualization/customproxy/doc/src/customproxy.qdoc
index e666c709..fe6a0d96 100644
--- a/examples/datavisualization/customproxy/doc/src/customproxy.qdoc
+++ b/examples/datavisualization/customproxy/doc/src/customproxy.qdoc
@@ -45,10 +45,10 @@
\c VariantDataSet class provides a simple API:
- \snippet ../examples/customproxy/variantdataset.h 1
+ \snippet customproxy/variantdataset.h 1
\dots 0
\codeline
- \snippet ../examples/customproxy/variantdataset.h 0
+ \snippet customproxy/variantdataset.h 0
As you can see, the data items are simply QVariantList objects, and the data can be added either
singly or in lists. The only additional functionality provided is clearing the data set and querying
@@ -60,17 +60,17 @@
\c VariantBarDataProxy is a subclass of QBarDataProxy and provides a simple API of just getters
and setters for the data set and the mapping:
- \snippet ../examples/customproxy/variantbardataproxy.h 0
+ \snippet customproxy/variantbardataproxy.h 0
\dots 0
\codeline
- \snippet ../examples/customproxy/variantbardataproxy.h 1
+ \snippet customproxy/variantbardataproxy.h 1
On the implementation side, the proxy listens for the changes in the data set and the mapping,
and resolves the data set if any changes are detected. It is not particularly efficient
implementation in that any change will cause re-resolving of the entire data set, but that is not
an issue for this example. The interesting part is the \c resolveDataSet() method:
- \snippet ../examples/customproxy/variantbardataproxy.cpp 0
+ \snippet customproxy/variantbardataproxy.cpp 0
In \c resolveDataSet() method we sort the variant data values into rows and columns based on the
mapping. This is very similar to how QItemModelBarDataProxy handles mapping, except we use
@@ -83,16 +83,16 @@
and rows, columns, and values of \c QBarDataArray. It also contains the lists of rows and columns to
be included in the resolved data:
- \snippet ../examples/customproxy/variantbardatamapping.h 0
+ \snippet customproxy/variantbardatamapping.h 0
\dots 0
\codeline
- \snippet ../examples/customproxy/variantbardatamapping.h 1
+ \snippet customproxy/variantbardatamapping.h 1
\dots 0
\codeline
- \snippet ../examples/customproxy/variantbardatamapping.h 2
+ \snippet customproxy/variantbardatamapping.h 2
\dots 0
\codeline
- \snippet ../examples/customproxy/variantbardatamapping.h 3
+ \snippet customproxy/variantbardatamapping.h 3
The primary way to use a \c VariantBarDataMapping object is to give the mappings already at the
constructor, though they can be set later individually or all together with the \c remap() method.
@@ -104,10 +104,10 @@
\c RainfallGraph class handles the setup of the graph. The interesting part is the \c addDataSet()
method:
- \snippet ../examples/customproxy/rainfallgraph.cpp 0
+ \snippet customproxy/rainfallgraph.cpp 0
The bulk of that method is used for populating the variant data set. Once the set is populated,
visualizing the data is trivial with the help of our custom proxy:
- \snippet ../examples/customproxy/rainfallgraph.cpp 1
+ \snippet customproxy/rainfallgraph.cpp 1
*/
diff --git a/examples/datavisualization/itemmodel/doc/src/itemmodel.qdoc b/examples/datavisualization/itemmodel/doc/src/itemmodel.qdoc
index 16cd1974..a3e7a5c5 100644
--- a/examples/datavisualization/itemmodel/doc/src/itemmodel.qdoc
+++ b/examples/datavisualization/itemmodel/doc/src/itemmodel.qdoc
@@ -39,7 +39,7 @@
First, in main.cpp, we create a QApplication, instantiate Q3DBars and a window container for it:
- \snippet ../examples/itemmodel/main.cpp 0
+ \snippet itemmodel/main.cpp 0
The call to QWidget::createWindowContainer is required, as all data visualization types
(Q3DBars, Q3DScatter, and Q3DSurface) inherit QWindow. Any class inheriting QWindow cannot be used
@@ -47,7 +47,7 @@
Then we'll create a layout and add the graph and the table widget into it:
- \snippet ../examples/itemmodel/main.cpp 1
+ \snippet itemmodel/main.cpp 1
The table widget is going to be used to display the numerical data being inserted into the
graph, and to modify it (See \l {Adding data to the graph} and \l {Interacting with the data}).
@@ -55,7 +55,7 @@
We need to instantiate QItemModelBarDataProxy and a QBar3DSeries for it, and give the series
to the graph:
- \snippet ../examples/itemmodel/main.cpp 2
+ \snippet itemmodel/main.cpp 2
Here we tell the proxy to directly map the model's rows and columns into the proxy's rows and
columns instead of defining row and column roles to map for them. Then we give the model from
@@ -68,19 +68,19 @@
\l {Adding data to the graph} for details) and connect some signals between QBar3DSeries,
\c GraphDataGenerator, and QTableWidget (See \l {Interacting with the data} for a closer look):
- \snippet ../examples/itemmodel/main.cpp 3
+ \snippet itemmodel/main.cpp 3
The application main is done and we can show the graph and start the event loop:
- \snippet ../examples/itemmodel/main.cpp 4
+ \snippet itemmodel/main.cpp 4
\section1 Setting up the graph
Let's set up the visual attributes for the graph in the constructor of \c GraphDataGenerator:
- \snippet ../examples/itemmodel/main.cpp 5
- \snippet ../examples/itemmodel/main.cpp 6
- \snippet ../examples/itemmodel/main.cpp 7
+ \snippet itemmodel/main.cpp 5
+ \snippet itemmodel/main.cpp 6
+ \snippet itemmodel/main.cpp 7
First we set bar thickness ratio to 1.0, which means bars will be as wide as they are deep. 1.0
is also the default value, so the line is basically unnecessary. It's left there so you could
@@ -116,7 +116,7 @@
Let's have a look at the contents of the \c start() method:
- \snippet ../examples/itemmodel/main.cpp 8
+ \snippet itemmodel/main.cpp 8
The main thing \c start() does is set up the data model. It also activates a timer for getting
the accurate dimensions of the table widget after it's been filled with data. The reason we
@@ -126,26 +126,26 @@
In \c setupModel() we first introduce the row and column labels, and the actual data:
- \snippet ../examples/itemmodel/main.cpp 9
+ \snippet itemmodel/main.cpp 9
Then we set up the axes:
- \snippet ../examples/itemmodel/main.cpp 10
+ \snippet itemmodel/main.cpp 10
Next we will set up the table widget:
- \snippet ../examples/itemmodel/main.cpp 11
+ \snippet itemmodel/main.cpp 11
After that all that's left is adding the data to the table widget:
- \snippet ../examples/itemmodel/main.cpp 12
+ \snippet itemmodel/main.cpp 12
Now we have a bar graph and a table widget, both displaying the same data.
You're probably wondering how the data can be displayed in the graph, as the only thing we did
was add it to the table widget? That's because of what we did earlier, in the application main:
- \snippet ../examples/itemmodel/main.cpp 2
+ \snippet itemmodel/main.cpp 2
We created QItemModelBarDataProxy instance, and gave the proxy the model of the table widget
we just created. The proxy maps the rows and the columns in the model of the table widget into
@@ -156,7 +156,7 @@
We made a couple of signal connections in the application main earlier:
- \snippet ../examples/itemmodel/main.cpp 3
+ \snippet itemmodel/main.cpp 3
Now we'll find out what these were for.
@@ -164,12 +164,12 @@
QBar3DSeries::selectedBarChanged() is emitted when a bar is selected from the series. We connect
that to a method in the data generator that selects the same data item in the table widget:
- \snippet ../examples/itemmodel/main.cpp 13
+ \snippet itemmodel/main.cpp 13
The second connection does the opposite; it connects a signal from the table widget to a
method in the data generator. The method then selects the corresponding bar in the series:
- \snippet ../examples/itemmodel/main.cpp 14
+ \snippet itemmodel/main.cpp 14
You can even select an item in the widget and change the value of it, and the new value is
updated to the graph. This is handled again by the proxy with mapping between the data
diff --git a/examples/datavisualization/qmlbars/doc/src/qmlbars.qdoc b/examples/datavisualization/qmlbars/doc/src/qmlbars.qdoc
index cc344c9c..d3da5e6a 100644
--- a/examples/datavisualization/qmlbars/doc/src/qmlbars.qdoc
+++ b/examples/datavisualization/qmlbars/doc/src/qmlbars.qdoc
@@ -36,7 +36,7 @@
The example data is monthly income and expenses of a fictional company over several years.
The data is defined in a list model in \c Data.qml like this:
- \snippet ../examples/qmlbars/qml/qmlbars/Data.qml 0
+ \snippet qmlbars/qml/qmlbars/Data.qml 0
\dots
Each data item has four roles: year, month, income, and expenses. Years and months are natural to
@@ -46,7 +46,7 @@
Now we need to add the data to the Bars3D graph. We will create two Bar3DSeries inside it,
starting with a series for the income:
- \snippet ../examples/qmlbars/qml/qmlbars/main.qml 3
+ \snippet qmlbars/qml/qmlbars/main.qml 3
\dots
The data is attached to the \c itemModel property of the ItemModelBarDataProxy inside the
@@ -54,7 +54,7 @@
Then we add another series for the expenses:
- \snippet ../examples/qmlbars/qml/qmlbars/main.qml 4
+ \snippet qmlbars/qml/qmlbars/main.qml 4
\dots
We use the \c visible property of the series to hide the second series for now.
@@ -65,7 +65,7 @@
\c Axes.qml. This is done because the data contains abbreviated month names, which we don't want
to use for our column labels:
- \snippet ../examples/qmlbars/qml/qmlbars/Axes.qml 0
+ \snippet qmlbars/qml/qmlbars/Axes.qml 0
\section1 Switching series
@@ -74,14 +74,14 @@
visualized data between income, expenses, and both, by simply changing visibility of the two
series:
- \snippet ../examples/qmlbars/qml/qmlbars/main.qml 0
+ \snippet qmlbars/qml/qmlbars/main.qml 0
The axis change is done because income and expenses have a different label format. The same could have
been achieved using a single axis and just changing the label format.
The second interesting block is where we filter some of the rows away from the visualized data:
- \snippet ../examples/qmlbars/qml/qmlbars/main.qml 1
+ \snippet qmlbars/qml/qmlbars/main.qml 1
The filtering is done by setting \c autoRowCategories to false on the ItemModelBarDataProxy item and defining
the row categories explicitly. This way, only the items in specified rows are visualized.
@@ -89,5 +89,5 @@
The third interesting block shows how to get the row and column index of an item if you know the
row and column values by using ItemModelBarDataProxy methods \c rowCategoryIndex() and \c columnCategoryIndex():
- \snippet ../examples/qmlbars/qml/qmlbars/main.qml 2
+ \snippet qmlbars/qml/qmlbars/main.qml 2
*/
diff --git a/examples/datavisualization/qmlcustominput/doc/src/qmlcustominput.qdoc b/examples/datavisualization/qmlcustominput/doc/src/qmlcustominput.qdoc
index 7702dadf..166826c3 100644
--- a/examples/datavisualization/qmlcustominput/doc/src/qmlcustominput.qdoc
+++ b/examples/datavisualization/qmlcustominput/doc/src/qmlcustominput.qdoc
@@ -33,9 +33,9 @@
The default input handling mechanism is disabled by setting the inputHandler property to null.
- \snippet ../examples/qmlcustominput/qml/qmlcustominput/main.qml 0
+ \snippet qmlcustominput/qml/qmlcustominput/main.qml 0
\dots 0
- \snippet ../examples/qmlcustominput/qml/qmlcustominput/main.qml 1
+ \snippet qmlcustominput/qml/qmlcustominput/main.qml 1
\dots 0
\section1 Implementing custom selection handling
@@ -44,16 +44,16 @@
The mouse area is configured to capture hover events and has two custom properties for \c mouseX and \c mouseY
to store the last known mouse coordinates.
- \snippet ../examples/qmlcustominput/qml/qmlcustominput/main.qml 2
+ \snippet qmlcustominput/qml/qmlcustominput/main.qml 2
Whenever a pointer movement related signal is received the code updates the \c mouseX and \c mouseY properties.
- \snippet ../examples/qmlcustominput/qml/qmlcustominput/main.qml 3
+ \snippet qmlcustominput/qml/qmlcustominput/main.qml 3
As the selection is one shot, and is cleared each time a 3D frame is rendered, a timer is setup to retrigger selection so that the selection moves to the item
currently under the mouse cursor as the camera animates around the graph even when the mouse cursor is not moving.
- \snippet ../examples/qmlcustominput/qml/qmlcustominput/main.qml 4
+ \snippet qmlcustominput/qml/qmlcustominput/main.qml 4
\section1 Implementing custom zoom handling
@@ -62,7 +62,7 @@
based on the current subrange.
\dots
- \snippet ../examples/qmlcustominput/qml/qmlcustominput/main.qml 5
+ \snippet qmlcustominput/qml/qmlcustominput/main.qml 5
\dots
\section1 Implementing custom camera handling
@@ -70,10 +70,10 @@
The camera is animated to constantly rotate around the graph with two animations. The rotation around the graph is done with
a simple NumberAnimation that just increments during 20 seconds from 0 degrees to 360 degrees and sets the \l Q3DCamera::xRotation property.
- \snippet ../examples/qmlcustominput/qml/qmlcustominput/main.qml 6
+ \snippet qmlcustominput/qml/qmlcustominput/main.qml 6
The camera movement up and down is implemented with a SequentialAnimation that varies the \l Q3DCamera::yRotation property of the camera
from 5 degrees to 45 degrees and back with in and out easing.
- \snippet ../examples/qmlcustominput/qml/qmlcustominput/main.qml 7
+ \snippet qmlcustominput/qml/qmlcustominput/main.qml 7
*/
diff --git a/examples/datavisualization/qmllegend/doc/src/qmllegend.qdoc b/examples/datavisualization/qmllegend/doc/src/qmllegend.qdoc
index 586ba415..b7351721 100644
--- a/examples/datavisualization/qmllegend/doc/src/qmllegend.qdoc
+++ b/examples/datavisualization/qmllegend/doc/src/qmllegend.qdoc
@@ -35,15 +35,15 @@
The legend is simply a column of custom \c LegendItem items inside a transparent rectangle.
Each item is supplied with a series and the graph theme:
- \snippet ../examples/qmllegend/qml/qmllegend/main.qml 0
+ \snippet qmllegend/qml/qmllegend/main.qml 0
The legend items consist of a marker rectangle, which indicates the color of the series,
and a text field, which shows the name of the series. The colors we get from the series and
the theme supplied at legend item initialization:
- \snippet ../examples/qmllegend/qml/qmllegend/LegendItem.qml 0
+ \snippet qmllegend/qml/qmllegend/LegendItem.qml 0
\dots 4
- \snippet ../examples/qmllegend/qml/qmllegend/LegendItem.qml 1
+ \snippet qmllegend/qml/qmllegend/LegendItem.qml 1
We want the legend to be interactive, so we add additional logic to enable selection of a
series by clicking on a legend item, as well as highlighting the legend item corresponding
@@ -52,16 +52,16 @@
The highlight depends on the selection state of the series, so we define two states, which
follow the Bar3DSeries::selectedBar property and adjust the \c legendItem color appropriately:
- \snippet ../examples/qmllegend/qml/qmllegend/LegendItem.qml 3
+ \snippet qmllegend/qml/qmllegend/LegendItem.qml 3
To make the legend item interactive, we define a MouseArea to detect clicks on it and adjust
the series selection accordingly:
- \snippet ../examples/qmllegend/qml/qmllegend/LegendItem.qml 2
+ \snippet qmllegend/qml/qmllegend/LegendItem.qml 2
The \c previousSelection used above is another custom property of \c LegendItem, which we update
whenever selection changes on the series. This way we remember the last selected bar of
each series:
- \snippet ../examples/qmllegend/qml/qmllegend/LegendItem.qml 4
+ \snippet qmllegend/qml/qmllegend/LegendItem.qml 4
*/
diff --git a/examples/datavisualization/qmlmultigraph/doc/src/qmlmultigraph.qdoc b/examples/datavisualization/qmlmultigraph/doc/src/qmlmultigraph.qdoc
index 5fa25500..4d6da7ab 100644
--- a/examples/datavisualization/qmlmultigraph/doc/src/qmlmultigraph.qdoc
+++ b/examples/datavisualization/qmlmultigraph/doc/src/qmlmultigraph.qdoc
@@ -36,7 +36,7 @@
and position the graphs as normal. In this example the graphs are shown in a 2 x 2 grid with
\c{GridLayout}:
- \snippet ../examples/qmlmultigraph/qml/qmlmultigraph/main.qml 0
+ \snippet qmlmultigraph/qml/qmlmultigraph/main.qml 0
Each graph has a parent \c Rectangle item to provide it with a border. The color of the rectangle
is set to fully transparent, because otherwise the rectangles would hide the graphs, which are
diff --git a/examples/datavisualization/qmloscilloscope/doc/src/qmloscilloscope.qdoc b/examples/datavisualization/qmloscilloscope/doc/src/qmloscilloscope.qdoc
index 9fdcd8d2..13e50709 100644
--- a/examples/datavisualization/qmloscilloscope/doc/src/qmloscilloscope.qdoc
+++ b/examples/datavisualization/qmloscilloscope/doc/src/qmloscilloscope.qdoc
@@ -42,18 +42,18 @@
The \c DataSource class provides three methods that can be called from QML:
- \snippet ../examples/qmloscilloscope/datasource.h 0
+ \snippet qmloscilloscope/datasource.h 0
The first method, \c generateData(), creates a cache of simulated oscilloscope data for us
to display. The data is cached in a format accepted by QSurfaceDataProxy:
- \snippet ../examples/qmloscilloscope/datasource.cpp 0
+ \snippet qmloscilloscope/datasource.cpp 0
The secod method, \c update(), copies one set of the cached data into another array, which we
set to the data proxy of the series by calling QSurfaceDataProxy::resetArray().
We reuse the same array if the array dimensions have not changed to minimize overhead:
- \snippet ../examples/qmloscilloscope/datasource.cpp 1
+ \snippet qmloscilloscope/datasource.cpp 1
\note Even though we are operating on the array pointer we have previously set to the proxy
we still need to call QSurfaceDataProxy::resetArray() after changing the data in it to prompt
@@ -62,18 +62,18 @@
The final method, \c selectionLabel(), is used to generate a label string we can show on the
QML ui. This method utilizes the axis formats to format the label:
- \snippet ../examples/qmloscilloscope/datasource.cpp 2
+ \snippet qmloscilloscope/datasource.cpp 2
To be able to access the \c DataSource methods from QML, we need to expose it. We do this by
defining a context property in application main:
- \snippet ../examples/qmloscilloscope/main.cpp 0
+ \snippet qmloscilloscope/main.cpp 0
\section1 QML
In the QML codes, we define a Surface3D graph normally and give it a Surface3DSeries:
- \snippet ../examples/qmloscilloscope/qml/qmloscilloscope/main.qml 0
+ \snippet qmloscilloscope/qml/qmloscilloscope/main.qml 0
One interesting detail is that we don't specify a proxy for the Surface3DSeries we attach
to the graph. This makes the series to utilize the default QSurfaceDataProxy.
@@ -86,17 +86,17 @@
\c updateSelectionLabel(), which calls one of the methods we defined for our \c DataSource class
to obtain the label:
- \snippet ../examples/qmloscilloscope/qml/qmloscilloscope/main.qml 1
+ \snippet qmloscilloscope/qml/qmloscilloscope/main.qml 1
We initialize the \c DataSource cache when the graph is complete by calling a helper function
\c generateData(), which calls the method with the same name on the \c DataSource:
- \snippet ../examples/qmloscilloscope/qml/qmloscilloscope/main.qml 2
+ \snippet qmloscilloscope/qml/qmloscilloscope/main.qml 2
\dots 4
- \snippet ../examples/qmloscilloscope/qml/qmloscilloscope/main.qml 4
+ \snippet qmloscilloscope/qml/qmloscilloscope/main.qml 4
To trigger the updates in data, we define a \c Timer item which calls the \c update() method on the \c
DataSource at requested intervals. The label update is also triggered on each cycle:
- \snippet ../examples/qmloscilloscope/qml/qmloscilloscope/main.qml 3
+ \snippet qmloscilloscope/qml/qmloscilloscope/main.qml 3
*/
diff --git a/examples/datavisualization/qmlscatter/doc/src/qmlscatter.qdoc b/examples/datavisualization/qmlscatter/doc/src/qmlscatter.qdoc
index fe86d740..236238e1 100644
--- a/examples/datavisualization/qmlscatter/doc/src/qmlscatter.qdoc
+++ b/examples/datavisualization/qmlscatter/doc/src/qmlscatter.qdoc
@@ -44,13 +44,13 @@
with
- \snippet ../examples/qmlscatter/main.cpp 0
+ \snippet qmlscatter/main.cpp 0
This will make application deployment easier.
We'll enable anti-aliasing for our application in environments that support it:
- \snippet ../examples/qmlscatter/main.cpp 2
+ \snippet qmlscatter/main.cpp 2
We'll also change the application to be shown maximized by replacing
@@ -58,7 +58,7 @@
with
- \snippet ../examples/qmlscatter/main.cpp 1
+ \snippet qmlscatter/main.cpp 1
We won't look into that any closer, as we'll change nothing in the generated
\c qtquick2applicationviewer files.
@@ -86,14 +86,14 @@
First we'll import all the QML modules we need:
- \snippet ../examples/qmlscatter/qml/qmlscatter/main.qml 0
+ \snippet qmlscatter/qml/qmlscatter/main.qml 0
The last \c import just imports all the qml files in the same directory as our \c {main.qml},
because that's where \c NewButton.qml and \c Data.qml are.
Then we create our main \c Item and call it \c mainView:
- \snippet ../examples/qmlscatter/qml/qmlscatter/main.qml 1
+ \snippet qmlscatter/qml/qmlscatter/main.qml 1
\note The Qt Creator application wizard will set a \c Rectangle item as the main item, which
is opaque white by default. This doesn't work for us, because the graphs are rendered behind the other
@@ -103,26 +103,26 @@
Then we'll add another \c Item inside it, and call it \c dataView. This will be the item to hold
the Scatter3D graph. We'll anchor it to the parent bottom:
- \snippet ../examples/qmlscatter/qml/qmlscatter/main.qml 9
+ \snippet qmlscatter/qml/qmlscatter/main.qml 9
Next we're ready to add the Scatter3D graph itself. We'll add it inside the \c dataView and
name it \c {scatterGraph}. Let's make it fill the \c {dataView}:
- \snippet ../examples/qmlscatter/qml/qmlscatter/main.qml 2
+ \snippet qmlscatter/qml/qmlscatter/main.qml 2
Now the graph is ready for use, but has no data. It also has the default axes and visual
properties.
Let's modify some visual properties first by adding the following inside \c {scatterGraph}:
- \snippet ../examples/qmlscatter/qml/qmlscatter/main.qml 3
+ \snippet qmlscatter/qml/qmlscatter/main.qml 3
We added a customized theme and changed the shadow quality.
We're happy with the other visual properties, so we won't change them.
The custom theme is based on a predefined theme, but we change the font in it:
- \snippet ../examples/qmlscatter/qml/qmlscatter/main.qml 13
+ \snippet qmlscatter/qml/qmlscatter/main.qml 13
Then it's time to start feeding the graph some data.
@@ -130,7 +130,7 @@
Let's create a \c Data item inside the \c mainView and name it \c seriesData:
- \snippet ../examples/qmlscatter/qml/qmlscatter/main.qml 4
+ \snippet qmlscatter/qml/qmlscatter/main.qml 4
The \c seriesData item contains the data models for all three series we use in this example.
@@ -140,7 +140,7 @@
In the main component we'll add the data itself in a \c ListModel and name it
\c {dataModel}:
- \snippet ../examples/qmlscatter/qml/qmlscatter/Data.qml 0
+ \snippet qmlscatter/qml/qmlscatter/Data.qml 0
\dots
We'll add two more of these for the other two series, and name them \c dataModelTwo and
@@ -149,39 +149,39 @@
Then we need to expose the data models to be usable from \c {main.qml}. We do this by defining
them as aliases in the main data component:
- \snippet ../examples/qmlscatter/qml/qmlscatter/Data.qml 1
+ \snippet qmlscatter/qml/qmlscatter/Data.qml 1
Now we can use the data from \c Data.qml with \c scatterGraph in \c {main.qml}. First we'll add
a Scatter3DSeries and call it \c {scatterSeries}:
- \snippet ../examples/qmlscatter/qml/qmlscatter/main.qml 5
+ \snippet qmlscatter/qml/qmlscatter/main.qml 5
Then we'll set up selection label format for the series:
- \snippet ../examples/qmlscatter/qml/qmlscatter/main.qml 10
+ \snippet qmlscatter/qml/qmlscatter/main.qml 10
And finally the data for series one in a ItemModelScatterDataProxy. We set the data itself as
\c itemModel for the proxy:
- \snippet ../examples/qmlscatter/qml/qmlscatter/main.qml 11
+ \snippet qmlscatter/qml/qmlscatter/main.qml 11
We'll add the other two series in the same way, but modify some series-specific details a bit:
- \snippet ../examples/qmlscatter/qml/qmlscatter/main.qml 12
+ \snippet qmlscatter/qml/qmlscatter/main.qml 12
\dots
Then we'll modify the properties of the default axes in \c scatterGraph a bit:
- \snippet ../examples/qmlscatter/qml/qmlscatter/main.qml 6
+ \snippet qmlscatter/qml/qmlscatter/main.qml 6
After that we'll just add a few buttons to the \c mainView to control the graph. We'll only
show one as an example:
- \snippet ../examples/qmlscatter/qml/qmlscatter/main.qml 7
+ \snippet qmlscatter/qml/qmlscatter/main.qml 7
Then we'll modify \c dataView to make room for the buttons at the top:
- \snippet ../examples/qmlscatter/qml/qmlscatter/main.qml 8
+ \snippet qmlscatter/qml/qmlscatter/main.qml 8
\dots
And we're done!
diff --git a/examples/datavisualization/qmlsurface/doc/src/qmlsurface.qdoc b/examples/datavisualization/qmlsurface/doc/src/qmlsurface.qdoc
index 00ef03d4..008fffa3 100644
--- a/examples/datavisualization/qmlsurface/doc/src/qmlsurface.qdoc
+++ b/examples/datavisualization/qmlsurface/doc/src/qmlsurface.qdoc
@@ -42,17 +42,17 @@
crater at imaginary position from 67 to 97 and from 30 to 60. Note that on the graph the scale
on the Y dimension exaggerates the height.
- \snippet ../examples/qmlsurface/qml/qmlsurface/main.qml 4
+ \snippet qmlsurface/qml/qmlsurface/main.qml 4
The other method to set surface data used in this example is with model mapping. We do that by
first defining a \c ListModel containing the data for the surface:
- \snippet ../examples/qmlsurface/qml/qmlsurface/Data.qml 0
+ \snippet qmlsurface/qml/qmlsurface/Data.qml 0
\dots 4
Then we set up a Surface3DSeries with a ItemModelSurfaceDataProxy:
- \snippet ../examples/qmlsurface/qml/qmlsurface/main.qml 5
+ \snippet qmlsurface/qml/qmlsurface/main.qml 5
\dots
We add the actual data to the \c itemModel of the ItemModelSurfaceDataProxy. We also define the
@@ -60,7 +60,7 @@
for latitude and the value is for height.
\dots 0
- \snippet ../examples/qmlsurface/qml/qmlsurface/main.qml 6
+ \snippet qmlsurface/qml/qmlsurface/main.qml 6
\section1 Showing data
@@ -70,25 +70,25 @@
First is the gradient to be used for the surface, which can be defined as seen in the following
snippet. With the ColorGradient we set example colors from position 0.0 to 1.0.
- \snippet ../examples/qmlsurface/qml/qmlsurface/main.qml 0
+ \snippet qmlsurface/qml/qmlsurface/main.qml 0
This element is set into the \c baseGradients property in the \c theme used in Surface3D:
- \snippet ../examples/qmlsurface/qml/qmlsurface/main.qml 7
+ \snippet qmlsurface/qml/qmlsurface/main.qml 7
Other interesting features can be controlled with buttons.
The first button is to toggle on and off the surface grid, for which we use the following code:
- \snippet ../examples/qmlsurface/qml/qmlsurface/main.qml 1
+ \snippet qmlsurface/qml/qmlsurface/main.qml 1
Second button is for surface shading mode, which is controlled with this code:
- \snippet ../examples/qmlsurface/qml/qmlsurface/main.qml 2
+ \snippet qmlsurface/qml/qmlsurface/main.qml 2
Third button is for series visibility, which is controlled with this code:
- \snippet ../examples/qmlsurface/qml/qmlsurface/main.qml 8
+ \snippet qmlsurface/qml/qmlsurface/main.qml 8
Notice that the \c drawMode and \c flatShadingEnable properties are set for both series.
@@ -98,7 +98,7 @@
HeightMapSurfaceDataProxy and the other one ItemModelSurfaceDataProxy. For this we use the
following code:
- \snippet ../examples/qmlsurface/qml/qmlsurface/main.qml 3
+ \snippet qmlsurface/qml/qmlsurface/main.qml 3
We also set the maximum value to 500 in model proxy to make the surface flatter and
250 on height map proxy to show exaggerated height. At the same time the middle color position
diff --git a/examples/datavisualization/qmlsurfacelayers/doc/src/qmlsurfacelayers.qdoc b/examples/datavisualization/qmlsurfacelayers/doc/src/qmlsurfacelayers.qdoc
index eab9f17f..eeb9e373 100644
--- a/examples/datavisualization/qmlsurfacelayers/doc/src/qmlsurfacelayers.qdoc
+++ b/examples/datavisualization/qmlsurfacelayers/doc/src/qmlsurfacelayers.qdoc
@@ -38,43 +38,43 @@
Let's start by creating a specific gradient for each layer:
- \snippet ../examples/qmlsurfacelayers/qml/qmlsurfacelayers/main.qml 0
+ \snippet qmlsurfacelayers/qml/qmlsurfacelayers/main.qml 0
Then we'll create the series themselves. It happens simply by adding 3 separate Surface3DSeries
to the Surface3D graph as children:
\dots 0
- \snippet ../examples/qmlsurfacelayers/qml/qmlsurfacelayers/main.qml 1
+ \snippet qmlsurfacelayers/qml/qmlsurfacelayers/main.qml 1
\dots 0
You'll notice we added the created gradients to the \c baseGradient properties of the series.
We could have added them to the \c baseGradients property of the Theme3D in Surface3D instead,
but doing it this way ensures each gradient is applied to a correct series:
- \snippet ../examples/qmlsurfacelayers/qml/qmlsurfacelayers/main.qml 2
+ \snippet qmlsurfacelayers/qml/qmlsurfacelayers/main.qml 2
\dots
\section1 Controlling the graph
Let's add some checkboxes to control the visibility of layers:
- \snippet ../examples/qmlsurfacelayers/qml/qmlsurfacelayers/main.qml 3
+ \snippet qmlsurfacelayers/qml/qmlsurfacelayers/main.qml 3
We don't need to do anything on the \c onCheckedChanged as we bound the \c checked state to
the \c visible property of the series directly:
\dots 0
- \snippet ../examples/qmlsurfacelayers/qml/qmlsurfacelayers/main.qml 4
+ \snippet qmlsurfacelayers/qml/qmlsurfacelayers/main.qml 4
\dots 0
Let's add some more checkboxes to control how the layers are displayed, when visible:
- \snippet ../examples/qmlsurfacelayers/qml/qmlsurfacelayers/main.qml 5
+ \snippet qmlsurfacelayers/qml/qmlsurfacelayers/main.qml 5
In addition to these we have two buttons, one of which is of special interest to us. It is used
to control whether we want to slice into only one layer, or all of them:
- \snippet ../examples/qmlsurfacelayers/qml/qmlsurfacelayers/main.qml 6
+ \snippet qmlsurfacelayers/qml/qmlsurfacelayers/main.qml 6
\section1 Example contents
*/
diff --git a/examples/datavisualization/rotations/doc/src/rotations.qdoc b/examples/datavisualization/rotations/doc/src/rotations.qdoc
index 2de29195..72facde0 100644
--- a/examples/datavisualization/rotations/doc/src/rotations.qdoc
+++ b/examples/datavisualization/rotations/doc/src/rotations.qdoc
@@ -39,9 +39,9 @@
In this example we want to orient the arrow items tangentially to the origin. This requires
rotating them, which can be achieved by specifying rotation quaternion to each item:
- \snippet ../examples/rotations/scatterdatamodifier.cpp 0
- \snippet ../examples/rotations/scatterdatamodifier.cpp 1
- \snippet ../examples/rotations/scatterdatamodifier.cpp 2
+ \snippet rotations/scatterdatamodifier.cpp 0
+ \snippet rotations/scatterdatamodifier.cpp 1
+ \snippet rotations/scatterdatamodifier.cpp 2
Since the items need to be rotated along two axes, we define two rotation quaternions, one
for Y-axis and one for Z-axis, and then multiply these together to get the total rotation,
@@ -53,7 +53,7 @@
we supply our own \c{narrowarrow.obj} file which contains the object definition for the mesh
in \c Wavefront obj format:
- \snippet ../examples/rotations/scatterdatamodifier.cpp 3
+ \snippet rotations/scatterdatamodifier.cpp 3
\section1 Using range gradient
@@ -62,7 +62,7 @@
part of the graph to be darker and gradually get lighter higher they are, so we define a
range gradient with black color at the position 0.0 and white color at the position 1.0:
- \snippet ../examples/rotations/scatterdatamodifier.cpp 4
+ \snippet rotations/scatterdatamodifier.cpp 4
\section1 Example contents
*/
diff --git a/examples/datavisualization/scatter/doc/src/scatter.qdoc b/examples/datavisualization/scatter/doc/src/scatter.qdoc
index 91227184..3c9d72bc 100644
--- a/examples/datavisualization/scatter/doc/src/scatter.qdoc
+++ b/examples/datavisualization/scatter/doc/src/scatter.qdoc
@@ -41,7 +41,7 @@
First, in main.cpp, we create a QApplication, instantiate Q3DScatter, and a window container
for it:
- \snippet ../examples/scatter/main.cpp 0
+ \snippet scatter/main.cpp 0
The call to QWidget::createWindowContainer is required, as all data visualization types
(Q3DBars, Q3DScatter, and Q3DSurface) inherit QWindow. Any class inheriting QWindow cannot be used
@@ -50,7 +50,7 @@
Then we'll create horizontal and vertical layouts. We'll add the graph and the vertical
layout into the horizontal one:
- \snippet ../examples/scatter/main.cpp 1
+ \snippet scatter/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}
@@ -59,18 +59,18 @@
graph. Let's call it \c ScatterDataModifier (See \l {Setting up the graph} and
\l {Adding data to the graph} for details):
- \snippet ../examples/scatter/main.cpp 2
+ \snippet scatter/main.cpp 2
The application main is done. We can show the graph and start the event loop:
- \snippet ../examples/scatter/main.cpp 3
+ \snippet scatter/main.cpp 3
\section1 Setting up the graph
Let's set up some visual qualities for the graph in the constructor of the \c ScatterDataModifier
class we instantiated in the application main:
- \snippet ../examples/scatter/scatterdatamodifier.cpp 0
+ \snippet scatter/scatterdatamodifier.cpp 0
None of these are required, but are used to override graph defaults. You can try how it looks
with the preset defaults by commenting the block above out.
@@ -78,7 +78,7 @@
Finally we create a QScatterDataProxy and the associated QScatter3DSeries. We set custom label format
and mesh smoothing for the series and add it to the graph:
- \snippet ../examples/scatter/scatterdatamodifier.cpp 2
+ \snippet scatter/scatterdatamodifier.cpp 2
That concludes setting up the graph.
@@ -86,26 +86,26 @@
The last thing we do in the \c ScatterDataModifier constructor is to add data to the graph:
- \snippet ../examples/scatter/scatterdatamodifier.cpp 3
+ \snippet scatter/scatterdatamodifier.cpp 3
The actual data addition is done in \c addData() method. First we configure the axes:
- \snippet ../examples/scatter/scatterdatamodifier.cpp 4
+ \snippet scatter/scatterdatamodifier.cpp 4
This could have been done in the constructor of \c {ScatterDataModifier}, but we added it here
to keep the constructor simpler and the axes configuration near the data.
Next we create a data array:
- \snippet ../examples/scatter/scatterdatamodifier.cpp 5
+ \snippet scatter/scatterdatamodifier.cpp 5
and populate it:
- \snippet ../examples/scatter/scatterdatamodifier.cpp 6
+ \snippet scatter/scatterdatamodifier.cpp 6
Finally we tell the proxy to start using the data we gave it:
- \snippet ../examples/scatter/scatterdatamodifier.cpp 7
+ \snippet scatter/scatterdatamodifier.cpp 7
Now our graph has the data and is ready to be used. There isn't much interaction yet, though,
so let's continue by adding some widgets to play with.
@@ -114,19 +114,19 @@
First, back in the application main, we'll create some widgets:
- \snippet ../examples/scatter/main.cpp 4
+ \snippet scatter/main.cpp 4
And add them to the vertical layout we created earlier:
- \snippet ../examples/scatter/main.cpp 5
+ \snippet scatter/main.cpp 5
Now, let's connect them to methods in ScatterDataModifier:
- \snippet ../examples/scatter/main.cpp 6
+ \snippet scatter/main.cpp 6
Here are the methods in ScatterDataModifier the signals were connected to:
- \snippet ../examples/scatter/scatterdatamodifier.cpp 8
+ \snippet scatter/scatterdatamodifier.cpp 8
And so we have an application in which we can control:
diff --git a/examples/datavisualization/surface/doc/src/surface.qdoc b/examples/datavisualization/surface/doc/src/surface.qdoc
index 5397b503..14a04668 100644
--- a/examples/datavisualization/surface/doc/src/surface.qdoc
+++ b/examples/datavisualization/surface/doc/src/surface.qdoc
@@ -44,7 +44,7 @@
First, in \c main.cpp, we create a QApplication, instantiate Q3DSurface, and a window container
for it:
- \snippet ../examples/surface/main.cpp 0
+ \snippet surface/main.cpp 0
The call to QWidget::createWindowContainer is required, as all data visualization types
(Q3DBars, Q3DScatter, and Q3DSurface) inherit QWindow. Any class inheriting QWindow cannot be used
@@ -53,7 +53,7 @@
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
+ \snippet 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
@@ -64,13 +64,13 @@
First we instantiate a new QSurfaceDataProxy and attach it to a new QSurface3DSeries:
- \snippet ../examples/surface/surfacegraph.cpp 0
+ \snippet surface/surfacegraph.cpp 0
Then we fill the proxy with a simple square root and sine wave data. This is done by
creating a new \c QSurfaceDataArray instance and adding \c QSurfaceDataRow elements to it.
The created \c QSurfaceDataArray is set to be the data array for the QSurfaceDataProxy.
- \snippet ../examples/surface/surfacegraph.cpp 1
+ \snippet surface/surfacegraph.cpp 1
The height map is created by instantiating a QHeightMapSurfaceDataProxy with
a QImage containing the height data. The method QHeightMapSurfaceDataProxy::setValueRanges() is
@@ -78,7 +78,7 @@
34.0\unicode 0x00B0 N - 40.0\unicode 0x00B0 N and 18.0\unicode 0x00B0 E - 24.0\unicode 0x00B0 E.
These values are used to show and position the map to the axis.
- \snippet ../examples/surface/surfacegraph.cpp 2
+ \snippet surface/surfacegraph.cpp 2
For demonstrating different proxies this example has two radio buttons which
the user can use to switch between the series. When the user selects the
@@ -88,13 +88,13 @@
ranges. Finally we make sure the correct series is added to the
graph:
- \snippet ../examples/surface/surfacegraph.cpp 3
+ \snippet surface/surfacegraph.cpp 3
When the \c{Height Map} radio button is activated, the following code sets the correct series active.
The axis label format is set to show N and E letters and ranges are set to the imaginary coordinates.
Auto adjusting Y-axis range is fine for our height map surface, so we ensure it is set.
- \snippet ../examples/surface/surfacegraph.cpp 4
+ \snippet surface/surfacegraph.cpp 4
\section1 Selection modes
@@ -102,7 +102,7 @@
example with radio buttons, which the user can use to activate a suitable selection mode.
The following inline methods are connected to radio buttons to activate the selected mode.
- \snippet ../examples/surface/surfacegraph.h 0
+ \snippet surface/surfacegraph.h 0
\section1 Axis ranges for studying the graph
@@ -110,11 +110,11 @@
axis. When selecting the proxy these sliders are adjusted so that one step on the slider
moves the range by one segment step:
- \snippet ../examples/surface/surfacegraph.cpp 8
+ \snippet surface/surfacegraph.cpp 8
The ranges are set for the axes like this:
- \snippet ../examples/surface/surfacegraph.cpp 5
+ \snippet surface/surfacegraph.cpp 5
\section1 Themes
@@ -123,7 +123,7 @@
menu to activate the selected theme. The theme type is changed to another predefined theme,
which overwrites all theme properties to predefined values:
- \snippet ../examples/surface/surfacegraph.cpp 6
+ \snippet surface/surfacegraph.cpp 6
\section1 Custom surface gradients
@@ -132,5 +132,5 @@
code shows how to create an example gradient and set it to the series. Note that you also need
to change the color style to Q3DTheme::ColorStyleRangeGradient to actually use the gradient.
- \snippet ../examples/surface/surfacegraph.cpp 7
+ \snippet surface/surfacegraph.cpp 7
*/