From 6c0b6c8fb3856c370c652e2398ccedbc5a025e91 2015-10-02 10:23:58 From: Miikka Heikkinen Date: 2015-10-02 10:23:58 Subject: [PATCH] Added trivial useOpenGL series test to qmlchartproperties manual test Change-Id: Ic7960c91ab6971d5f9317967333370cd2557af15 Reviewed-by: Titta Heikkala --- diff --git a/tests/manual/qmlchartproperties/qml/qmlchartproperties/ChartEditorSeries.qml b/tests/manual/qmlchartproperties/qml/qmlchartproperties/ChartEditorSeries.qml index aeb4855..817be56 100644 --- a/tests/manual/qmlchartproperties/qml/qmlchartproperties/ChartEditorSeries.qml +++ b/tests/manual/qmlchartproperties/qml/qmlchartproperties/ChartEditorSeries.qml @@ -17,7 +17,7 @@ ****************************************************************************/ import QtQuick 2.0 -import QtCharts 2.0 +import QtCharts 2.1 Flow { anchors.fill: parent @@ -27,15 +27,23 @@ Flow { Button { text: "add line" - onClicked: addXYSeries(ChartView.SeriesTypeLine, "line"); + onClicked: addXYSeries(ChartView.SeriesTypeLine, "line", false); + } + Button { + text: "add GL line" + onClicked: addXYSeries(ChartView.SeriesTypeLine, "GL line", true); } Button { text: "add spline" - onClicked: addXYSeries(ChartView.SeriesTypeSpline, "spline"); + onClicked: addXYSeries(ChartView.SeriesTypeSpline, "spline", false); } Button { text: "add scatter" - onClicked: addXYSeries(ChartView.SeriesTypeScatter, "scatter"); + onClicked: addXYSeries(ChartView.SeriesTypeScatter, "scatter", false); + } + Button { + text: "add GL scatter" + onClicked: addXYSeries(ChartView.SeriesTypeScatter, "GL scatter", true); } Button { text: "remove last" @@ -51,11 +59,16 @@ Flow { onClicked: chart.removeAllSeries(); } - function addXYSeries(type, name) { + function addXYSeries(type, name, openGl) { var series = chart.createSeries(type, name + " " + chart.count); - for (var i = chart.axisX().min; i < chart.axisX().max; i++) { + var multiplier = 10; + if (openGl) { + series.useOpenGL = true; + multiplier = 100; + } + for (var i = chart.axisX().min * multiplier; i < chart.axisX().max * multiplier; i++) { var y = Math.random() * (chart.axisY().max - chart.axisY().min) + chart.axisY().min; - var x = Math.random() + i; + var x = (Math.random() + i) / multiplier; series.append(x, y); } }