summaryrefslogtreecommitdiffstats
path: root/examples/datavisualization/qmlspectrogram/doc
diff options
context:
space:
mode:
authorTomi Korpipaa <tomi.korpipaa@qt.io>2023-02-03 10:17:27 +0200
committerTomi Korpipaa <tomi.korpipaa@qt.io>2023-02-10 10:41:08 +0200
commit6b9e8224c2e567ed0f42fa5ebc442d201615fa3e (patch)
tree6d73abb585ac2ad95544b5a9a8b88ea6e886e266 /examples/datavisualization/qmlspectrogram/doc
parent0dfb996b629d2815bccf32c481680c249f3133c9 (diff)
Combine 3 examples into one qmlsurfacegallery
Combine qmlsurface, qml3doscilloscope, and qmlspectrogram into one surface graph gallery example. Pick-to: 6.5 Fixes: QTBUG-110700 Change-Id: Ic8319884a61a12c5d65c68314c958a86d62a65b1 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
Diffstat (limited to 'examples/datavisualization/qmlspectrogram/doc')
-rw-r--r--examples/datavisualization/qmlspectrogram/doc/images/qmlspectrogram-example.pngbin80103 -> 0 bytes
-rw-r--r--examples/datavisualization/qmlspectrogram/doc/src/qmlspectrogram.qdoc78
2 files changed, 0 insertions, 78 deletions
diff --git a/examples/datavisualization/qmlspectrogram/doc/images/qmlspectrogram-example.png b/examples/datavisualization/qmlspectrogram/doc/images/qmlspectrogram-example.png
deleted file mode 100644
index de376cd9..00000000
--- a/examples/datavisualization/qmlspectrogram/doc/images/qmlspectrogram-example.png
+++ /dev/null
Binary files differ
diff --git a/examples/datavisualization/qmlspectrogram/doc/src/qmlspectrogram.qdoc b/examples/datavisualization/qmlspectrogram/doc/src/qmlspectrogram.qdoc
deleted file mode 100644
index b56e784c..00000000
--- a/examples/datavisualization/qmlspectrogram/doc/src/qmlspectrogram.qdoc
+++ /dev/null
@@ -1,78 +0,0 @@
-// Copyright (C) 2016 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
-
-/*!
- \example qmlspectrogram
- \meta tags {DataVisualization, Surface3D, Polar Graph, Surface Graph}
- \meta category {Graphics}
- \title Surface Spectrogram
- \ingroup qtdatavisualization_qmlexamples
- \brief Showing spectrogram graph in a QML application.
-
- The Surface Spectrogram example demonstrates how to show a polar and cartesian
- spectrograms and how to utilize orthographic projection to show them in 2D.
-
- \image qmlspectrogram-example.png
-
- Spectrogram is simply a surface graph with a range gradient used to emphasize the different
- values. Typically spectrograms are shown with two dimensional surfaces, which we simulate
- with a top down orthographic view of the graph. To enforce the 2D effect, we disable the
- graph rotation via mouse or touch when in the orthographic mode.
-
- The focus in this example is on showing how to display spectrograms, so the basic
- functionality is not explained. For more detailed QML example documentation,
- see \l{Simple Scatter Graph}.
-
- \include examples-run.qdocinc
-
- \section1 Creating a Spectrogram
-
- To create a 2D spectrogram, we define a Surface3D item:
-
- \snippet qmlspectrogram/qml/qmlspectrogram/main.qml 0
-
- The key properties for enabling the 2D effect are
- \l{AbstractGraph3D::orthoProjection}{orthoProjection} and
- \l{Camera3D::cameraPreset}{scene.activeCamera.cameraPreset}. We remove the perspective by
- enabling orthographic projection for the graph, and then we eliminate the Y-dimension by
- viewing the graph directly from above:
-
- \snippet qmlspectrogram/qml/qmlspectrogram/main.qml 1
-
- Since this viewpoint causes the horizontal axis grid to be mostly obscured by the surface,
- we also specify that the horizontal grid should be drawn on top of the graph:
-
- \snippet qmlspectrogram/qml/qmlspectrogram/main.qml 2
-
- \section1 Polar Spectrogram
-
- Depending on the data, it is sometimes more natural to use a polar graph instead of a cartesian
- one. Qt Data Visualization supports this via \l{AbstractGraph3D::polar}{polar} property.
- In this example we provide a button to switch between polar and cartesian modes:
-
- \snippet qmlspectrogram/qml/qmlspectrogram/main.qml 3
-
- In the polar mode, the X-axis is converted into the angular polar axis, and the Z-axis is
- converted into the radial polar axis. The surface points are recalculated according to new axes.
-
- The radial axis labels are drawn outside the graph by default, but in this example we want to
- draw them right next to the 0 degree angular axis inside the graph, so we define only a tiny
- offset for them:
-
- \snippet qmlspectrogram/qml/qmlspectrogram/main.qml 4
-
- To enforce the 2D effect, graph rotation via user input is disabled when in orthographic mode.
- We do this by specifying a new input handler:
-
- \snippet qmlspectrogram/qml/qmlspectrogram/main.qml 5
- \snippet qmlspectrogram/qml/qmlspectrogram/main.qml 7
- \dots 0
- \snippet qmlspectrogram/qml/qmlspectrogram/main.qml 6
- \dots 0
-
- When the projection mode changes, we adjust the value of the
- \l{InputHandler3D::rotationEnabled}{rotationEnabled} property of the \c{customInputHandler}
- to control the rotation.
-
- \section1 Example Contents
-*/