-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathQcharWidget.h
59 lines (43 loc) · 1.28 KB
/
QcharWidget.h
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#ifndef QCHARWIDGET_H
#define QCHARWIDGET_H
#include <QtWidgets/QWidget>
#include <QtCharts/QChartGlobal>
#include <QMap>
QT_CHARTS_BEGIN_NAMESPACE
class QChartView;
class QChart;
QT_CHARTS_END_NAMESPACE
typedef QPair<qreal, qreal> Data;
typedef QList<Data> DataList;
typedef QMap<QString,DataList> DataTable;
QT_CHARTS_USE_NAMESPACE
namespace Ui {
class ThemeWidgetForm;
}
class QcharWidget : public QWidget
{
Q_OBJECT
public:
explicit QcharWidget(QWidget *parent = 0);
virtual ~QcharWidget();
private Q_SLOTS:
void updateUI();
private:
void generateData();
void populateThemeBox();
void populateAnimationBox();
void populateLegendBox();
void connectSignals();
void createCommonAxis(QChart *chart, QStringList* categories=0) const;
QChart *createAreaChart() const;
QChart *createBarChart() const;
QChart *createPieChart() const;
QChart *createLineChart() const;
QChart *createSplineChart() const;
QChart *createScatterChart() const;
QStringList matchRegString(const QString& reg,const QString& str);
Ui::ThemeWidgetForm *m_ui;
QList<QChartView *> m_charts;
DataTable m_dataTable;
};
#endif // QCHARWIDGET_H