summaryrefslogtreecommitdiffstats
path: root/src/charts/doc/src/examples-qmloscilloscope.qdoc
blob: 207200cb13d2300028e0835783a68b421ec48d69 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Charts module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:GPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 or (at your option) any later version
** approved by the KDE Free Qt Foundation. The licenses are as published by
** the Free Software Foundation and appearing in the file LICENSE.GPL3
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/

/*!
    \example qmloscilloscope
    \title Qml Oscilloscope
    \ingroup qtcharts_examples

    \image examples_qmloscilloscope.png

    \brief The example shows how to implement application with strict performance requirements
    using the Qt Charts QML API.

    The oscilloscope application demonstrates how to use the Qt Charts QML API to implement an
    application with strict performance requirements. The application uses generated data with
    configurable characteristics to mimic a simple oscilloscope user interface.

    To get information about actual rendering speed shown in the application output console, you can
    set QSG_RENDER_TIMING = 1 to your run environment settings. To do so go to Projects - Run -
    Run environment in Qt Creator and select Add. Then you can experiment with the different
    configurable options of the example application to find the configuration that gives you the
    best performance in your environment.

    The application window is shared by control and scope views:
    \snippet qmloscilloscope/qml/qmloscilloscope/main.qml 1
    \dots
    \snippet qmloscilloscope/qml/qmloscilloscope/main.qml 2

    ControlView implements the buttons used for configuring. ScopeView uses a ChartView to show
    a chart with two line series:
    \snippet qmloscilloscope/qml/qmloscilloscope/ScopeView.qml 1
    \dots

    The data of the line series is updated with a QML timer. In a real life application the
    updating could be triggered with a signal from Qt C++ code.
    \snippet qmloscilloscope/qml/qmloscilloscope/ScopeView.qml 2

    The oscilloscope also allows you to switch the type of the series used for visualizing the
    signal sources. This is implemented by dynamically destroying and creating series:
    \snippet qmloscilloscope/qml/qmloscilloscope/ScopeView.qml 3

*/