summaryrefslogtreecommitdiffstats
path: root/examples/qmloscilloscope/datasource.h
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@digia.com>2014-02-04 14:48:34 +0200
committerTomi Korpipää <tomi.korpipaa@digia.com>2014-02-05 10:26:36 +0200
commit79f3a4d7aa2fcbdc5df133ede88a367aa5870bd3 (patch)
treea66a16e576a4918f20b1a388d8fd3c5150603e57 /examples/qmloscilloscope/datasource.h
parent81234154b77ad079999542a4dd4bee454c46fb26 (diff)
Add qmloscilloscope example
+Fix itemAt() in surface proxy +Add itemAt(QPoint) in bar and surface proxies +Misc fixes to other examples Task-number: QTRD-2816 Change-Id: I5e06cfce98f74719a20885e3ca5a1e6fefb23a9c Reviewed-by: Tomi Korpipää <tomi.korpipaa@digia.com>
Diffstat (limited to 'examples/qmloscilloscope/datasource.h')
-rw-r--r--examples/qmloscilloscope/datasource.h55
1 files changed, 55 insertions, 0 deletions
diff --git a/examples/qmloscilloscope/datasource.h b/examples/qmloscilloscope/datasource.h
new file mode 100644
index 00000000..6ef0cacb
--- /dev/null
+++ b/examples/qmloscilloscope/datasource.h
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** 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
+**
+****************************************************************************/
+
+#ifndef DATASOURCE_H
+#define DATASOURCE_H
+
+#include <QtDataVisualization>
+#include <QObject>
+
+class QQuickView;
+
+using namespace QtDataVisualization;
+
+class DataSource : public QObject
+{
+ Q_OBJECT
+public:
+ explicit DataSource(QQuickView *appViewer, QObject *parent = 0);
+ virtual ~DataSource();
+
+ //! [0]
+public slots:
+ void generateData(int cacheCount, int rowCount, int columnCount,
+ float xMin, float xMax, float yMin, float yMax, float zMin, float zMax);
+
+ void update(QSurface3DSeries *series);
+
+ QString selectionLabel(QSurface3DSeries *series, QValue3DAxis *axisX,
+ QValue3DAxis *axisY, QValue3DAxis *axisZ);
+ //! [0]
+private:
+ void clearData();
+
+ QQuickView *m_appViewer;
+ QVector<QSurfaceDataArray> m_data;
+ int m_index;
+ QSurfaceDataArray *m_resetArray;
+};
+
+#endif