Debian Codegraph @

tests/manual/openglseriestest/mainwindow.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 MAINWINDOW_H
5 #define MAINWINDOW_H
6
7 #include "datasource.h"
8 #include <QtWidgets/QMainWindow>
9 #include <QtCharts/QChart>
10
11 QT_BEGIN_NAMESPACE
12 class QBrush;
13 class QPen;
14
15 namespace Ui {
16 class MainWindow;
17 }
18 QT_END_NAMESPACE
19
20
21 QT_USE_NAMESPACE
22
23 class MainWindow : public QMainWindow
24 {
25 Q_OBJECT
26
27 public:
28 explicit MainWindow(QWidget *parent = 0);
29 ~MainWindow();
30
31 public slots:
32 void xMinChanged(double value);
33 void xMaxChanged(double value);
34 void yMinChanged(double value);
35 void yMaxChanged(double value);
36 void animationIndexChanged(int index);
37 void xRangeChanged(qreal min, qreal max);
38 void yRangeChanged(qreal min, qreal max);
39 void xAxisIndexChanged(int index);
40 void yAxisIndexChanged(int index);
41 void backgroundIndexChanged(int index);
42 void plotAreaIndexChanged(int index);
43 void themeIndexChanged(int index);
44 void addSeriesClicked();
45 void removeSeriesClicked();
46 void addGLSeriesClicked();
47 void countIndexChanged(int index);
48 void colorIndexChanged(int index);
49 void widthIndexChanged(int index);
50 void antiAliasCheckBoxClicked(bool checked);
51 void handleHovered(const QPointF &point, bool state);
52 void handleClicked(const QPointF &point);
53 void handlePressed(const QPointF &point);
54 void handleReleased(const QPointF &point);
55 void handleDoubleClicked(const QPointF &point);
56
57 private:
58 enum AxisMode {
59 AxisModeNone,
60 AxisModeValue,
61 AxisModeLogValue,
62 AxisModeDateTime,
63 AxisModeCategory
64 };
65
66 void initXYValueChart();
67 void setXAxis(AxisMode mode);
68 void setYAxis(AxisMode mode);
69
70 void applyRanges();
71 void applyCategories();
72 void addSeries(bool gl);
73
74 Ui::MainWindow *ui;
75
76 qreal m_xMin;
77 qreal m_xMax;
78 qreal m_yMin;
79 qreal m_yMax;
80 QBrush *m_backgroundBrush;
81 QBrush *m_plotAreaBackgroundBrush;
82 QPen *m_backgroundPen;
83 QPen *m_plotAreaBackgroundPen;
84 QChart::AnimationOptions m_animationOptions;
85
86 QChart *m_chart;
87 QAbstractAxis *m_xAxis;
88 QAbstractAxis *m_yAxis;
89 AxisMode m_xAxisMode;
90 AxisMode m_yAxisMode;
91
92 QList<QXYSeries *> m_seriesList;
93 DataSource m_dataSource;
94 int m_pointCount;
95 };
96
97 #endif // MAINWINDOW_H