diff options
author | Miikka Heikkinen <miikka.heikkinen@theqtcompany.com> | 2015-09-29 16:49:59 +0300 |
---|---|---|
committer | Miikka Heikkinen <miikka.heikkinen@theqtcompany.com> | 2015-09-30 07:45:08 +0000 |
commit | faab188cb2e7188ae47ea0ece4b451d503fbe5cf (patch) | |
tree | 8a754cbca7d336952818b50af41d81ecb84bfb93 /examples/charts | |
parent | 9aa888c2f56cdb91952fd70e85aec8cb5886d727 (diff) |
Made Qml Oscilloscope example little more sensible
Removed spline and animations as the point of the example is to
demonstrate high refresh rate use case. Also now default to useOpenGL.
Change-Id: Iaf43bd8789893a9ed9bc409038e7d22d1bd7185d
Reviewed-by: Titta Heikkala <titta.heikkala@theqtcompany.com>
Diffstat (limited to 'examples/charts')
3 files changed, 14 insertions, 27 deletions
diff --git a/examples/charts/qmloscilloscope/qml/qmloscilloscope/ControlPanel.qml b/examples/charts/qmloscilloscope/qml/qmloscilloscope/ControlPanel.qml index ddde6324..4f84b392 100644 --- a/examples/charts/qmloscilloscope/qml/qmloscilloscope/ControlPanel.qml +++ b/examples/charts/qmloscilloscope/qml/qmloscilloscope/ControlPanel.qml @@ -21,6 +21,7 @@ import QtQuick.Layouts 1.0 ColumnLayout { property alias openGLButton: openGLButton + property alias antialiasButton: antialiasButton spacing: 8 Layout.fillHeight: true signal animationsEnabled(bool enabled) @@ -40,13 +41,13 @@ ColumnLayout { id: openGLButton text: "OpenGL: " items: ["false", "true"] - currentSelection: 0 + currentSelection: 1 onSelectionChanged: openGlChanged(currentSelection == 1); } MultiButton { text: "Graph: " - items: ["line", "spline", "scatter"] + items: ["line", "scatter"] currentSelection: 0 onSelectionChanged: seriesTypeChanged(items[currentSelection]); } @@ -81,15 +82,10 @@ ColumnLayout { } MultiButton { - text: "Animations: " - items: ["OFF", "ON"] - currentSelection: 0 - onSelectionChanged: animationsEnabled(currentSelection == 1); - } - - MultiButton { + id: antialiasButton text: "Antialias: " items: ["OFF", "ON"] + enabled: false currentSelection: 0 onSelectionChanged: antialiasingEnabled(currentSelection == 1); } diff --git a/examples/charts/qmloscilloscope/qml/qmloscilloscope/ScopeView.qml b/examples/charts/qmloscilloscope/qml/qmloscilloscope/ScopeView.qml index 443e515a..ad432b2f 100644 --- a/examples/charts/qmloscilloscope/qml/qmloscilloscope/ScopeView.qml +++ b/examples/charts/qmloscilloscope/qml/qmloscilloscope/ScopeView.qml @@ -24,7 +24,7 @@ ChartView { id: chartView animationOptions: ChartView.NoAnimation theme: ChartView.ChartThemeDark - property bool openGL: false + property bool openGL: true onOpenGLChanged: { series("signal 1").useOpenGL = openGL; series("signal 2").useOpenGL = openGL; @@ -92,19 +92,16 @@ ChartView { var series2 = chartView.createSeries(ChartView.SeriesTypeLine, "signal 2", axisX, axisY2); series2.useOpenGL = chartView.openGL - } else if (type == "spline") { - chartView.createSeries(ChartView.SeriesTypeSpline, "signal 1", axisX, axisY1); - chartView.createSeries(ChartView.SeriesTypeSpline, "signal 2", axisX, axisY2); } else { var series1 = chartView.createSeries(ChartView.SeriesTypeScatter, "signal 1", axisX, axisY1); - series1.markerSize = 3; + series1.markerSize = 2; series1.borderColor = "transparent"; series1.useOpenGL = chartView.openGL var series2 = chartView.createSeries(ChartView.SeriesTypeScatter, "signal 2", axisX, axisY2); - series2.markerSize = 3; + series2.markerSize = 2; series2.borderColor = "transparent"; series2.useOpenGL = chartView.openGL } diff --git a/examples/charts/qmloscilloscope/qml/qmloscilloscope/main.qml b/examples/charts/qmloscilloscope/qml/qmloscilloscope/main.qml index 5340177e..219b89fe 100644 --- a/examples/charts/qmloscilloscope/qml/qmloscilloscope/main.qml +++ b/examples/charts/qmloscilloscope/qml/qmloscilloscope/main.qml @@ -41,20 +41,14 @@ Rectangle { dataSource.generateData(1, signalCount, sampleCount); scopeView.axisX().max = sampleCount; } - onAnimationsEnabled: scopeView.setAnimations(enabled); - onSeriesTypeChanged: { - scopeView.changeSeriesType(type); - if (type === "spline") { - controlPanel.openGLButton.currentSelection = 0; - controlPanel.openGLButton.enabled = false; - scopeView.openGL = false; - } else { - controlPanel.openGLButton.enabled = true; - } - } + onSeriesTypeChanged: scopeView.changeSeriesType(type); onRefreshRateChanged: scopeView.changeRefreshRate(rate); onAntialiasingEnabled: scopeView.antialiasing = enabled; - onOpenGlChanged: scopeView.openGL = enabled; + onOpenGlChanged: { + scopeView.openGL = enabled; + antialiasButton.enabled = !enabled; + antialiasButton.currentSelection = 0; + } } //![2] |