summaryrefslogtreecommitdiffstats
path: root/tests/qmlperf/qml/qmlperf
diff options
context:
space:
mode:
authorMika Salmela <mika.salmela@theqtcompany.com>2014-11-03 11:22:23 +0200
committerMika Salmela <mika.salmela@theqtcompany.com>2014-11-03 11:23:13 +0200
commita1feedcf46975a65970fb946282c742b091b508e (patch)
tree990cf6ee09700ebac84fb4cbe333ab91fde37aee /tests/qmlperf/qml/qmlperf
parent0090db160242374d7ab6e3bedf064b366716f770 (diff)
Qml perf data generation on cpp
Change-Id: If770c96ff84e49a747c4355e56bff002556cd659 Reviewed-by: Mika Salmela <mika.salmela@theqtcompany.com>
Diffstat (limited to 'tests/qmlperf/qml/qmlperf')
-rw-r--r--tests/qmlperf/qml/qmlperf/main.qml18
-rw-r--r--tests/qmlperf/qml/qmlperf/script.js33
2 files changed, 4 insertions, 47 deletions
diff --git a/tests/qmlperf/qml/qmlperf/main.qml b/tests/qmlperf/qml/qmlperf/main.qml
index 35f8df5d..bb3f1b82 100644
--- a/tests/qmlperf/qml/qmlperf/main.qml
+++ b/tests/qmlperf/qml/qmlperf/main.qml
@@ -20,7 +20,6 @@ import QtQuick 2.1
import QtQuick.Layouts 1.0
import QtQuick.Controls 1.0
import QtDataVisualization 1.1
-import "script.js" as Script
import "."
Rectangle {
@@ -29,7 +28,7 @@ Rectangle {
height: 1024
property var itemCount: 1000.0
- property var addItems: 1000.0
+ property var addItems: 500.0
Button {
id: changeButton
@@ -90,7 +89,7 @@ Rectangle {
text: "Add"
onClicked: {
itemCount = itemCount + addItems;
- Script.createData(addItems);
+ dataGenerator.add(scatterSeries, addItems);
}
}
@@ -102,11 +101,6 @@ Rectangle {
anchors.left: mainview.left
state: "meshsphere"
- ListModel {
- id: dataModel
- Component.onCompleted: Script.createData(itemCount)
- }
-
Scatter3D {
id: scatterPlot
width: graphView.width
@@ -134,13 +128,9 @@ Rectangle {
Scatter3DSeries {
id: scatterSeries
mesh: Abstract3DSeries.MeshSphere
- ItemModelScatterDataProxy {
- itemModel: dataModel
- xPosRole: "x"
- yPosRole: "y"
- zPosRole: "z"
- }
}
+
+ Component.onCompleted: dataGenerator.generateData(scatterSeries, itemCount);
}
states: [
diff --git a/tests/qmlperf/qml/qmlperf/script.js b/tests/qmlperf/qml/qmlperf/script.js
deleted file mode 100644
index dc271e8d..00000000
--- a/tests/qmlperf/qml/qmlperf/script.js
+++ /dev/null
@@ -1,33 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Digia Plc
-** All rights reserved.
-** For any questions to Digia, please use contact form at http://qt.digia.com
-**
-** This file is part of the QtDataVisualization module.
-**
-** Licensees holding valid Qt Enterprise licenses may use this file in
-** accordance with the Qt Enterprise License Agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia.
-**
-** If you have questions regarding the use of this file, please use
-** contact form at http://qt.digia.com
-**
-****************************************************************************/
-
-//function createData(base) {
-// for (var z = 0; z < 30; z++) {
-// for (var x = 0; x < 30; x++) {
-// var angle = (((z - 16) * (x - 16)) / 144.0) * 1.57;
-// var y = Math.sin(angle + base);
-// dataModel.append({"z": z, "x": x, "y": y});
-// }
-// }
-//}
-
-function createData(base) {
- for (var i = 0; i < base; i++) {
- dataModel.append({"z": Math.random(), "x": Math.random(), "y": Math.random()});
- }
-}