summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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]