summaryrefslogtreecommitdiffstats
path: root/examples/charts
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@qt.io>2016-08-25 14:40:26 +0300
committerMiikka Heikkinen <miikka.heikkinen@qt.io>2016-08-25 11:58:16 +0000
commit5f058945d31965417ebfe73b364f0430244baf8b (patch)
tree9142cab1474ab6037b8a417bf3e26a6b47782372 /examples/charts
parent2c769e64ad58da5454a44affb64b9e003381da35 (diff)
Fix qmloscilloscope example when using software backend
The example incorrectly showed OpenGL to be in use even when Qt was configured with -no-opengl. Change-Id: I22905f7d41fe8e4b04fc1c3473b9924b8c82b06c Reviewed-by: Mika Salmela <mika.salmela@qt.io> Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Diffstat (limited to 'examples/charts')
-rw-r--r--examples/charts/qmloscilloscope/qml/qmloscilloscope/ScopeView.qml13
-rw-r--r--examples/charts/qmloscilloscope/qml/qmloscilloscope/main.qml7
2 files changed, 18 insertions, 2 deletions
diff --git a/examples/charts/qmloscilloscope/qml/qmloscilloscope/ScopeView.qml b/examples/charts/qmloscilloscope/qml/qmloscilloscope/ScopeView.qml
index b393b9ff..9eb9f9af 100644
--- a/examples/charts/qmloscilloscope/qml/qmloscilloscope/ScopeView.qml
+++ b/examples/charts/qmloscilloscope/qml/qmloscilloscope/ScopeView.qml
@@ -36,9 +36,18 @@ ChartView {
animationOptions: ChartView.NoAnimation
theme: ChartView.ChartThemeDark
property bool openGL: true
+ property bool openGLSupported: true
onOpenGLChanged: {
- series("signal 1").useOpenGL = openGL;
- series("signal 2").useOpenGL = openGL;
+ if (openGLSupported) {
+ series("signal 1").useOpenGL = openGL;
+ series("signal 2").useOpenGL = openGL;
+ }
+ }
+ Component.onCompleted: {
+ if (!series("signal 1").useOpenGL) {
+ openGLSupported = false
+ openGL = false
+ }
}
ValueAxis {
diff --git a/examples/charts/qmloscilloscope/qml/qmloscilloscope/main.qml b/examples/charts/qmloscilloscope/qml/qmloscilloscope/main.qml
index a8260564..3479c523 100644
--- a/examples/charts/qmloscilloscope/qml/qmloscilloscope/main.qml
+++ b/examples/charts/qmloscilloscope/qml/qmloscilloscope/main.qml
@@ -67,6 +67,13 @@ Item {
anchors.right: parent.right
anchors.left: controlPanel.right
height: main.height
+
+ onOpenGLSupportedChanged: {
+ if (!openGLSupported) {
+ controlPanel.openGLButton.enabled = false
+ controlPanel.openGLButton.currentSelection = 0
+ }
+ }
}
//![2]