| 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 <QtCharts/QPolarChart> |
| 8 |
#include <QtWidgets/QMainWindow> |
| 9 |
#include <QtGui/QFont> |
| 10 |
#include <QtCharts/QChart> |
| 11 |
#include <QtCharts/QScatterSeries> |
| 12 |
#include <QtCharts/QLineSeries> |
| 13 |
#include <QtCharts/QSplineSeries> |
| 14 |
#include <QtCharts/QAreaSeries> |
| 15 |
|
| 16 |
QT_BEGIN_NAMESPACE |
| 17 |
class QBrush; |
| 18 |
class QPen; |
| 19 |
|
| 20 |
namespace Ui { |
| 21 |
class MainWindow; |
| 22 |
} |
| 23 |
QT_END_NAMESPACE |
| 24 |
|
| 25 |
|
| 26 |
QT_USE_NAMESPACE |
| 27 |
|
| 28 |
class MainWindow : public QMainWindow |
| 29 |
{ |
| 30 |
Q_OBJECT |
| 31 |
|
| 32 |
public: |
| 33 |
explicit MainWindow(QWidget *parent = 0); |
| 34 |
~MainWindow(); |
| 35 |
|
| 36 |
public slots: |
| 37 |
void angularTicksChanged(int value); |
| 38 |
void radialTicksChanged(int value); |
| 39 |
void angularMinorTicksChanged(int value); |
| 40 |
void radialMinorTicksChanged(int value); |
| 41 |
void anglesChanged(int value); |
| 42 |
void angularMinChanged(double value); |
| 43 |
void angularMaxChanged(double value); |
| 44 |
void radialMinChanged(double value); |
| 45 |
void radialMaxChanged(double value); |
| 46 |
void angularShadesIndexChanged(int index); |
| 47 |
void radialShadesIndexChanged(int index); |
| 48 |
void labelFormatEdited(const QString &text); |
| 49 |
void labelFontChanged(const QFont &font); |
| 50 |
void labelFontSizeChanged(int value); |
| 51 |
void animationIndexChanged(int index); |
| 52 |
void labelsIndexChanged(int index); |
| 53 |
void titleIndexChanged(int index); |
| 54 |
void titleFontChanged(const QFont &font); |
| 55 |
void titleFontSizeChanged(int value); |
| 56 |
void gridIndexChanged(int index); |
| 57 |
void minorGridIndexChanged(int index); |
| 58 |
void gridLineColorIndexChanged(int index); |
| 59 |
void arrowIndexChanged(int index); |
| 60 |
void angularRangeChanged(qreal min, qreal max); |
| 61 |
void radialRangeChanged(qreal min, qreal max); |
| 62 |
void angularAxisIndexChanged(int index); |
| 63 |
void radialAxisIndexChanged(int index); |
| 64 |
void logBaseChanged(double value); |
| 65 |
void niceNumbersChecked(); |
| 66 |
void dateFormatEdited(const QString &text); |
| 67 |
void moreCategoriesChecked(); |
| 68 |
void categoryLabelLocationChecked(); |
| 69 |
void series1CheckBoxChecked(); |
| 70 |
void series2CheckBoxChecked(); |
| 71 |
void series3CheckBoxChecked(); |
| 72 |
void series4CheckBoxChecked(); |
| 73 |
void series5CheckBoxChecked(); |
| 74 |
void series6CheckBoxChecked(); |
| 75 |
void series7CheckBoxChecked(); |
| 76 |
void themeIndexChanged(int index); |
| 77 |
void seriesHovered(QPointF point, bool state); |
| 78 |
void seriesClicked(const QPointF &point); |
| 79 |
void backgroundIndexChanged(int index); |
| 80 |
void plotAreaIndexChanged(int index); |
| 81 |
|
| 82 |
private: |
| 83 |
enum AxisMode { |
| 84 |
AxisModeNone, |
| 85 |
AxisModeValue, |
| 86 |
AxisModeLogValue, |
| 87 |
AxisModeDateTime, |
| 88 |
AxisModeCategory |
| 89 |
}; |
| 90 |
|
| 91 |
void initXYValueChart(); |
| 92 |
void setAngularAxis(AxisMode mode); |
| 93 |
void setRadialAxis(AxisMode mode); |
| 94 |
|
| 95 |
void applyRanges(); |
| 96 |
void applyCategories(); |
| 97 |
|
| 98 |
Ui::MainWindow *ui; |
| 99 |
|
| 100 |
int m_angularTickCount; |
| 101 |
int m_radialTickCount; |
| 102 |
int m_angularMinorTickCount; |
| 103 |
int m_radialMinorTickCount; |
| 104 |
qreal m_labelsAngle; |
| 105 |
qreal m_angularMin; |
| 106 |
qreal m_angularMax; |
| 107 |
qreal m_radialMin; |
| 108 |
qreal m_radialMax; |
| 109 |
bool m_angularShadesVisible; |
| 110 |
bool m_radialShadesVisible; |
| 111 |
bool m_labelsVisible; |
| 112 |
bool m_titleVisible; |
| 113 |
bool m_gridVisible; |
| 114 |
bool m_arrowVisible; |
| 115 |
bool m_minorGridVisible; |
| 116 |
bool m_minorArrowVisible; |
| 117 |
QBrush *m_angularShadesBrush; |
| 118 |
QBrush *m_radialShadesBrush; |
| 119 |
QBrush *m_labelBrush; |
| 120 |
QBrush *m_titleBrush; |
| 121 |
QBrush *m_backgroundBrush; |
| 122 |
QBrush *m_plotAreaBackgroundBrush; |
| 123 |
QPen *m_angularShadesPen; |
| 124 |
QPen *m_radialShadesPen; |
| 125 |
QPen *m_gridPen; |
| 126 |
QPen *m_arrowPen; |
| 127 |
QPen *m_minorGridPen; |
| 128 |
QPen *m_backgroundPen; |
| 129 |
QPen *m_plotAreaBackgroundPen; |
| 130 |
QString m_labelFormat; |
| 131 |
QFont m_currentLabelFont; |
| 132 |
QFont m_currentTitleFont; |
| 133 |
QChart::AnimationOptions m_animationOptions; |
| 134 |
QString m_angularTitle; |
| 135 |
QString m_radialTitle; |
| 136 |
qreal m_base; |
| 137 |
QString m_dateFormat; |
| 138 |
|
| 139 |
QPolarChart *m_chart; |
| 140 |
QAbstractAxis *m_angularAxis; |
| 141 |
QAbstractAxis *m_radialAxis; |
| 142 |
AxisMode m_angularAxisMode; |
| 143 |
AxisMode m_radialAxisMode; |
| 144 |
bool m_moreCategories; |
| 145 |
|
| 146 |
QScatterSeries *m_series1; |
| 147 |
QLineSeries *m_series2; |
| 148 |
QLineSeries *m_series3; |
| 149 |
QLineSeries *m_series4; |
| 150 |
QAreaSeries *m_series5; |
| 151 |
QSplineSeries *m_series6; |
| 152 |
QScatterSeries *m_series7; |
| 153 |
}; |
| 154 |
|
| 155 |
#endif // MAINWINDOW_H |