Debian Codegraph @

tests/manual/openglseriestest/datasource.h

raw
1 // Copyright (C) 2016 The Qt Company Ltd.
2 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4 #ifndef DATASOURCE_H
5 #define DATASOURCE_H
6
7 #include <QtCore/QObject>
8 #include <QtCharts/QXYSeries>
9 #include <QtWidgets/QLabel>
10 #include <QtCore/QElapsedTimer>
11 #include <QtCore/QTimer>
12
13 QT_USE_NAMESPACE
14
15 const int maxSeriesCount = 10;
16
17 class DataSource : public QObject
18 {
19 Q_OBJECT
20 public:
21 explicit DataSource(QObject *parent = 0);
22
23 void startUpdates(QList<QXYSeries *> &seriesList, QLabel *fpsLabel, int interval);
24
25 public slots:
26 void generateData(int seriesIndex, int rowCount, int colCount);
27 void update(QXYSeries *series, int seriesIndex);
28 void handleSceneChanged();
29 void updateAllSeries();
30 void setInterval(int interval);
31
32 private:
33 QList<QList<QList<QPointF>>> m_data;
34 int m_index;
35 QList<QXYSeries *> *m_seriesList;
36 QLabel *m_fpsLabel;
37 QElapsedTimer m_fpsTimer;
38 QTimer m_dataUpdater;
39 };
40
41 #endif // DATASOURCE_H