| 1 |
// Copyright (C) 2016 The Qt Company Ltd. |
| 2 |
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only |
| 3 |
|
| 4 |
#ifndef MAINWIDGET_H |
| 5 |
#define MAINWIDGET_H |
| 6 |
|
| 7 |
#include <QtCharts/QChartGlobal> |
| 8 |
#include <QtCharts/QChart> |
| 9 |
#include <QtCharts/QChartView> |
| 10 |
#include <QtWidgets/QWidget> |
| 11 |
|
| 12 |
QT_BEGIN_NAMESPACE |
| 13 |
class QSpinBox; |
| 14 |
class QCheckBox; |
| 15 |
class QGridLayout; |
| 16 |
QT_END_NAMESPACE |
| 17 |
|
| 18 |
QT_USE_NAMESPACE |
| 19 |
|
| 20 |
#define RealList QList<qreal> |
| 21 |
class DataSerieDialog; |
| 22 |
|
| 23 |
class MainWidget : public QWidget |
| 24 |
{ |
| 25 |
Q_OBJECT |
| 26 |
public: |
| 27 |
explicit MainWidget(QWidget *parent = 0); |
| 28 |
|
| 29 |
signals: |
| 30 |
|
| 31 |
private: |
| 32 |
void initBackroundCombo(QGridLayout *grid); |
| 33 |
void initScaleControls(QGridLayout *grid); |
| 34 |
void initThemeCombo(QGridLayout *grid); |
| 35 |
void initCheckboxes(QGridLayout *grid); |
| 36 |
|
| 37 |
private slots: |
| 38 |
void addSeries(); |
| 39 |
void addSeries(QString series, int columnCount, int rowCount, QString dataCharacteristics, bool labelsEnabled); |
| 40 |
void backgroundChanged(int itemIndex); |
| 41 |
void autoScaleChanged(int value); |
| 42 |
void xMinChanged(int value); |
| 43 |
void xMaxChanged(int value); |
| 44 |
void yMinChanged(int value); |
| 45 |
void yMaxChanged(int value); |
| 46 |
void antiAliasToggled(bool enabled); |
| 47 |
void openGLToggled(bool enabled); |
| 48 |
void changeChartTheme(int themeIndex); |
| 49 |
QList<RealList> generateTestData(int columnCount, int rowCount, QString dataCharacteristics); |
| 50 |
QStringList generateLabels(int count); |
| 51 |
|
| 52 |
private: |
| 53 |
DataSerieDialog *m_addSerieDialog; |
| 54 |
QChart *m_chart; |
| 55 |
QChartView *m_chartView; |
| 56 |
QCheckBox *m_autoScaleCheck; |
| 57 |
QSpinBox *m_xMinSpin; |
| 58 |
QSpinBox *m_xMaxSpin; |
| 59 |
QSpinBox *m_yMinSpin; |
| 60 |
QSpinBox *m_yMaxSpin; |
| 61 |
QString m_defaultSeriesName; |
| 62 |
QGridLayout *m_scatterLayout; |
| 63 |
}; |
| 64 |
|
| 65 |
#endif // MAINWIDGET_H |