summaryrefslogtreecommitdiffstats
path: root/doc/src/demos-qmloscilloscope.qdoc
blob: be5b29542cd3477219da417ef0f336dab80706fd (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
/*!
    \example demos/qmloscilloscope
    \title Oscilloscope

    \image demos_qmloscilloscope.png

    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 find out the
    actual screen refresh performance of the application, you can set QML_SHOW_FRAMERATE = 1 to
    your run environment settings to get the framerate shown in the application output console.
    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 demo application to find the
    configuration that gives you the best performance in your environment.

    Note: You can try if enabling OpenGL improves the performance with the following startup
    parameter:
    \code
    -graphicssystem opengl
    \endcode

    The application window is shared by control and scope views:
    \snippet ../demos/qmloscilloscope/qml/qmloscilloscope/main.qml 1
    \snippet ../demos/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 ../demos/qmloscilloscope/qml/qmloscilloscope/ScopeView.qml 1

    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 ../demos/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 ../demos/qmloscilloscope/qml/qmloscilloscope/ScopeView.qml 3
*/