From a1feedcf46975a65970fb946282c742b091b508e Mon Sep 17 00:00:00 2001 From: Mika Salmela Date: Mon, 3 Nov 2014 11:22:23 +0200 Subject: Qml perf data generation on cpp Change-Id: If770c96ff84e49a747c4355e56bff002556cd659 Reviewed-by: Mika Salmela --- tests/qmlperf/qml/qmlperf/main.qml | 18 ++++-------------- tests/qmlperf/qml/qmlperf/script.js | 33 --------------------------------- 2 files changed, 4 insertions(+), 47 deletions(-) delete mode 100644 tests/qmlperf/qml/qmlperf/script.js (limited to 'tests/qmlperf/qml/qmlperf') 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()}); - } -} -- cgit v1.2.3