blob: e5577dd357e44666e33e11bb7d7eedf63a80bab6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#ifndef CHART_H
#define CHART_H
#include <QtCharts/QChart>
#include <QtCore/QTimer>
QT_BEGIN_NAMESPACE
class QSplineSeries;
class QValueAxis;
QT_END_NAMESPACE
QT_USE_NAMESPACE
//![1]
class Chart: public QChart
{
Q_OBJECT
public:
Chart(QGraphicsItem *parent = nullptr, Qt::WindowFlags wFlags = {});
virtual ~Chart();
public slots:
void handleTimeout();
private:
QTimer m_timer;
QSplineSeries *m_series;
QStringList m_titles;
QValueAxis *m_axisX;
QValueAxis *m_axisY;
qreal m_step;
qreal m_x;
qreal m_y;
};
//![1]
#endif /* CHART_H */
|