summaryrefslogtreecommitdiffstats
path: root/tests/qmlperf
diff options
context:
space:
mode:
Diffstat (limited to 'tests/qmlperf')
-rw-r--r--tests/qmlperf/datagenerator.cpp27
-rw-r--r--tests/qmlperf/datagenerator.h9
-rw-r--r--tests/qmlperf/main.cpp6
-rw-r--r--tests/qmlperf/qml/qmlperf/main.qml26
4 files changed, 51 insertions, 17 deletions
diff --git a/tests/qmlperf/datagenerator.cpp b/tests/qmlperf/datagenerator.cpp
index 28056234..aeab6554 100644
--- a/tests/qmlperf/datagenerator.cpp
+++ b/tests/qmlperf/datagenerator.cpp
@@ -1,15 +1,15 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc
+** Copyright (C) 2015 The Qt Company Ltd
** All rights reserved.
-** For any questions to Digia, please use contact form at http://qt.io
+** For any questions to The Qt Company, please use contact form at http://qt.io
**
** This file is part of the Qt Data Visualization module.
**
** Licensees holding valid commercial license for Qt may use this file in
** accordance with the Qt License Agreement provided with the Software
** or, alternatively, in accordance with the terms contained in a written
-** agreement between you and Digia.
+** agreement between you and The Qt Company.
**
** If you have questions regarding the use of this file, please use
** contact form at http://qt.io
@@ -27,11 +27,18 @@ DataGenerator::DataGenerator(QObject *parent) :
QObject(parent)
{
qRegisterMetaType<QScatter3DSeries *>();
+
+ m_file = new QFile("results.txt");
+ if (!m_file->open(QIODevice::WriteOnly | QIODevice::Text)) {
+ delete m_file;
+ m_file = 0;
+ }
}
DataGenerator::~DataGenerator()
{
- qDebug() << __FUNCTION__;
+ m_file->close();
+ delete m_file;
}
void DataGenerator::generateData(QScatter3DSeries *series, uint count)
@@ -65,3 +72,15 @@ void DataGenerator::add(QScatter3DSeries *series, uint count)
series->dataProxy()->addItems(appendArray);
}
+
+void DataGenerator::writeLine(int itemCount, float fps)
+{
+ if (m_file) {
+ QTextStream out(m_file);
+
+ QString fpsFormatString(QStringLiteral("%1 %2\n"));
+ QString fpsString = fpsFormatString.arg(itemCount).arg(fps);
+
+ out << fpsString;
+ }
+}
diff --git a/tests/qmlperf/datagenerator.h b/tests/qmlperf/datagenerator.h
index c066d80c..ce7d235e 100644
--- a/tests/qmlperf/datagenerator.h
+++ b/tests/qmlperf/datagenerator.h
@@ -1,15 +1,15 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc
+** Copyright (C) 2015 The Qt Company Ltd
** All rights reserved.
-** For any questions to Digia, please use contact form at http://qt.io
+** For any questions to The Qt Company, please use contact form at http://qt.io
**
** This file is part of the Qt Data Visualization module.
**
** Licensees holding valid commercial license for Qt may use this file in
** accordance with the Qt License Agreement provided with the Software
** or, alternatively, in accordance with the terms contained in a written
-** agreement between you and Digia.
+** agreement between you and The Qt Company.
**
** If you have questions regarding the use of this file, please use
** contact form at http://qt.io
@@ -20,6 +20,7 @@
#define DATAGENERATOR_H
#include <QtDataVisualization/QScatter3DSeries>
+#include <QtCore/QFile>
using namespace QtDataVisualization;
@@ -33,9 +34,11 @@ public:
public slots:
void generateData(QScatter3DSeries *series, uint count);
void add(QScatter3DSeries *series, uint count);
+ void writeLine(int itemCount, float fps);
private:
QScatter3DSeries m_series;
+ QFile *m_file;
};
#endif // DATAGENERATOR_H
diff --git a/tests/qmlperf/main.cpp b/tests/qmlperf/main.cpp
index 18b9cd08..e6393025 100644
--- a/tests/qmlperf/main.cpp
+++ b/tests/qmlperf/main.cpp
@@ -1,15 +1,15 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc
+** Copyright (C) 2015 The Qt Company Ltd
** All rights reserved.
-** For any questions to Digia, please use contact form at http://qt.io
+** For any questions to The Qt Company, please use contact form at http://qt.io
**
** This file is part of the Qt Data Visualization module.
**
** Licensees holding valid commercial license for Qt may use this file in
** accordance with the Qt License Agreement provided with the Software
** or, alternatively, in accordance with the terms contained in a written
-** agreement between you and Digia.
+** agreement between you and The Qt Company.
**
** If you have questions regarding the use of this file, please use
** contact form at http://qt.io
diff --git a/tests/qmlperf/qml/qmlperf/main.qml b/tests/qmlperf/qml/qmlperf/main.qml
index 796325e0..0f9f22f7 100644
--- a/tests/qmlperf/qml/qmlperf/main.qml
+++ b/tests/qmlperf/qml/qmlperf/main.qml
@@ -1,15 +1,15 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc
+** Copyright (C) 2015 The Qt Company Ltd
** All rights reserved.
-** For any questions to Digia, please use contact form at http://qt.io
+** For any questions to The Qt Company, please use contact form at http://qt.io
**
** This file is part of the Qt Data Visualization module.
**
** Licensees holding valid commercial license for Qt may use this file in
** accordance with the Qt License Agreement provided with the Software
** or, alternatively, in accordance with the terms contained in a written
-** agreement between you and Digia.
+** agreement between you and The Qt Company.
**
** If you have questions regarding the use of this file, please use
** contact form at http://qt.io
@@ -32,7 +32,7 @@ Rectangle {
Button {
id: changeButton
- width: 350
+ width: parent.width / 7
height: 50
anchors.left: parent.left
enabled: true
@@ -54,7 +54,7 @@ Rectangle {
Text {
id: fpsText
text: "Reading"
- width: 300
+ width: (parent.width / 7) * 3
height: 50
anchors.left: changeButton.right
verticalAlignment: Text.AlignVCenter
@@ -63,7 +63,7 @@ Rectangle {
Button {
id: optimization
- width: 300
+ width: parent.width / 7
height: 50
anchors.left: fpsText.right
enabled: true
@@ -82,7 +82,7 @@ Rectangle {
Button {
id: itemAdd
- width: 300
+ width: parent.width / 7
height: 50
anchors.left: optimization.right
enabled: true
@@ -93,6 +93,18 @@ Rectangle {
}
}
+ Button {
+ id: writeLine
+ width: parent.width / 7
+ height: 50
+ anchors.left: itemAdd.right
+ enabled: true
+ text: "Write"
+ onClicked: {
+ dataGenerator.writeLine(itemCount, scatterPlot.currentFps.toFixed(1));
+ }
+ }
+
Item {
id: graphView
width: mainview.width