summaryrefslogtreecommitdiffstats
path: root/examples/charts
diff options
context:
space:
mode:
Diffstat (limited to 'examples/charts')
-rw-r--r--examples/charts/qmloscilloscope/qml/qmloscilloscope/ControlPanel.qml14
-rw-r--r--examples/charts/qmloscilloscope/qml/qmloscilloscope/ScopeView.qml9
-rw-r--r--examples/charts/qmloscilloscope/qml/qmloscilloscope/main.qml18
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]