summaryrefslogtreecommitdiffstats
path: root/examples/datavisualization/scatter/doc
diff options
context:
space:
mode:
authorTomi Korpipaa <tomi.korpipaa@qt.io>2023-02-14 09:31:41 +0200
committerTomi Korpipaa <tomi.korpipaa@qt.io>2023-02-27 13:07:40 +0200
commitcbaa2eaaf73ffa0d2b4ba999c993199fc22110ea (patch)
tree4e6e63c5976425861fd8a0feebdc9c2286898073 /examples/datavisualization/scatter/doc
parent23bd5e3ca472cbe8b4a7b5a82a4b8fb9a98ca830 (diff)
Combine 2 more widget examples into graph gallery
Combine the 2 scatter graph examples into graph gallery example. Note: surface examples will be combined into graph gallery in other commits, to avoid making one gigantic commit. Pick-to: 6.5 Task-number: QTBUG-110698 Change-Id: I8c50d07a31a8b1ee84596f4e216e629d88c7846a Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
Diffstat (limited to 'examples/datavisualization/scatter/doc')
-rw-r--r--examples/datavisualization/scatter/doc/images/scatter-example.pngbin142496 -> 0 bytes
-rw-r--r--examples/datavisualization/scatter/doc/src/scatter.qdoc135
2 files changed, 0 insertions, 135 deletions
diff --git a/examples/datavisualization/scatter/doc/images/scatter-example.png b/examples/datavisualization/scatter/doc/images/scatter-example.png
deleted file mode 100644
index 82c13855..00000000
--- a/examples/datavisualization/scatter/doc/images/scatter-example.png
+++ /dev/null
Binary files differ
diff --git a/examples/datavisualization/scatter/doc/src/scatter.qdoc b/examples/datavisualization/scatter/doc/src/scatter.qdoc
deleted file mode 100644
index 6322e9cb..00000000
--- a/examples/datavisualization/scatter/doc/src/scatter.qdoc
+++ /dev/null
@@ -1,135 +0,0 @@
-// Copyright (C) 2016 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
-
-/*!
- \example scatter
- \meta tags {DataVisualization, Q3DScatter}
- \meta category {Graphics}
- \title Scatter Graph
- \ingroup qtdatavisualization_examples
- \brief Using Q3DScatter in a widget application.
-
- The scatter graph example shows how to make a simple 3D scatter graph using Q3DScatter and
- combining the use of widgets for adjusting several adjustable qualities. The example shows
- how to:
-
- \list
- \li Create an application with Q3DScatter and some widgets
- \li Use QScatterDataProxy to set data to the graph
- \li Adjust some graph properties using widget controls
- \endlist
-
- For instructions about how to interact with the graph, see \l{Qt Data Visualization Interacting with Data}{this page}.
-
- \image scatter-example.png
-
- \include examples-run.qdocinc
-
- \section1 Creating the Application
-
- First, in main.cpp, we create a QApplication, instantiate Q3DScatter, and a window container
- for it:
-
- \snippet scatter/main.cpp 0
-
- The call to QWidget::createWindowContainer is required, as all data visualization graph classes
- (Q3DBars, Q3DScatter, and 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 and the vertical
- layout into the horizontal one:
-
- \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}
-
- Next, let's create another class to handle the data addition and other interaction with the
- graph. Let's call it \c ScatterDataModifier (See \l {Setting up the graph} and
- \l {Adding data to the graph} for details):
-
- \snippet scatter/main.cpp 2
-
- The application main is done. We can show the graph and start the event loop:
-
- \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 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.
-
- 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 scatter/scatterdatamodifier.cpp 2
-
- That concludes setting up the graph.
-
- \section1 Adding Data to the Graph
-
- The last thing we do in the \c ScatterDataModifier constructor is to add data to the graph:
-
- \snippet scatter/scatterdatamodifier.cpp 3
-
- The actual data addition is done in \c addData() method. First we configure the axes:
-
- \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 scatter/scatterdatamodifier.cpp 5
-
- and populate it:
-
- \snippet scatter/scatterdatamodifier.cpp 6
-
- Finally we tell the proxy to start using the data we gave it:
-
- \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.
-
- \section1 Using Widgets to Control the Graph
-
- First, back in the application main, we'll create some widgets:
-
- \snippet scatter/main.cpp 4
-
- And add them to the vertical layout we created earlier:
-
- \snippet scatter/main.cpp 5
-
- Now, let's connect them to methods in ScatterDataModifier:
-
- \snippet scatter/main.cpp 6
-
- Here are the methods in ScatterDataModifier the signals were connected to:
-
- \snippet scatter/scatterdatamodifier.cpp 8
-
- And so we have an application in which we can control:
-
- \list
- \li Label style
- \li Camera preset
- \li Background visibility
- \li Grid visibility
- \li Dot shading smoothness
- \li Dot style
- \li Theme
- \li Shadow quality
- \li Label font
- \endlist
-
- \section1 Example Contents
-*/