diff options
Diffstat (limited to 'examples/datavisualization/qmloscilloscope')
3 files changed, 25 insertions, 1 deletions
diff --git a/examples/datavisualization/qmloscilloscope/doc/src/qmloscilloscope.qdoc b/examples/datavisualization/qmloscilloscope/doc/src/qmloscilloscope.qdoc index e5a84b86..c574950b 100644 --- a/examples/datavisualization/qmloscilloscope/doc/src/qmloscilloscope.qdoc +++ b/examples/datavisualization/qmloscilloscope/doc/src/qmloscilloscope.qdoc @@ -107,4 +107,20 @@ DataSource at requested intervals. The label update is also triggered on each cycle: \snippet qmloscilloscope/qml/qmloscilloscope/main.qml 3 + + \section1 Enabling direct rendering + + Since this application potentially deals with a lot of rapidly changing data, we use direct + rendering mode for performance. To enable antialiasing in this mode the surface format of the application + window needs to be changed, as the default format used by QQuickView doesn't support antialiasing. + We use the utility function provided by Qt Data Visualization to change the surface format + in \c main.cpp: + + \snippet qmloscilloscope/main.cpp 1 + \dots 0 + \snippet qmloscilloscope/main.cpp 2 + + On the QML side, direct rendering mode is enabled via \l{AbstractGraph3D::renderingMode}{renderingMode} property: + + \snippet qmloscilloscope/qml/qmloscilloscope/main.qml 5 */ diff --git a/examples/datavisualization/qmloscilloscope/main.cpp b/examples/datavisualization/qmloscilloscope/main.cpp index 3e99c4a0..9ee46e21 100644 --- a/examples/datavisualization/qmloscilloscope/main.cpp +++ b/examples/datavisualization/qmloscilloscope/main.cpp @@ -17,7 +17,10 @@ ****************************************************************************/ #include "datasource.h" + +//! [2] #include <QtDataVisualization/qutils.h> +//! [2] #include <QtGui/QGuiApplication> #include <QtCore/QDir> @@ -31,8 +34,10 @@ int main(int argc, char *argv[]) QQuickView viewer; - // Enable antialiasing + // Enable antialiasing in direct rendering mode + //! [1] viewer.setFormat(QtDataVisualization::qDefaultSurfaceFormat()); + //! [1] // The following are needed to make examples run without having to install the module // in desktop environments. diff --git a/examples/datavisualization/qmloscilloscope/qml/qmloscilloscope/main.qml b/examples/datavisualization/qmloscilloscope/qml/qmloscilloscope/main.qml index 6034109b..eeaeab40 100644 --- a/examples/datavisualization/qmloscilloscope/qml/qmloscilloscope/main.qml +++ b/examples/datavisualization/qmloscilloscope/qml/qmloscilloscope/main.qml @@ -49,6 +49,9 @@ Item { height: dataView.height shadowQuality: AbstractGraph3D.ShadowQualityNone selectionMode: AbstractGraph3D.SelectionSlice | AbstractGraph3D.SelectionItemAndRow + //! [5] + renderingMode: AbstractGraph3D.RenderDirectToBackground + //! [5] axisX.labelFormat: "%d ms" axisY.labelFormat: "%d W" |