mainwidget.h
87 lines
| 2.5 KiB
| text/x-c
|
CLexer
Miikka Heikkinen
|
r2854 | /**************************************************************************** | ||
Marek Rosa
|
r1365 | ** | ||
Miikka Heikkinen
|
r2854 | ** Copyright (C) 2016 The Qt Company Ltd. | ||
** Contact: https://www.qt.io/licensing/ | ||||
Marek Rosa
|
r1365 | ** | ||
Miikka Heikkinen
|
r2854 | ** This file is part of the Qt Charts module of the Qt Toolkit. | ||
Marek Rosa
|
r1365 | ** | ||
Miikka Heikkinen
|
r2854 | ** $QT_BEGIN_LICENSE:GPL$ | ||
Titta Heikkala
|
r2845 | ** Commercial License Usage | ||
** Licensees holding valid commercial Qt licenses may use this file in | ||||
** accordance with the commercial license agreement provided with the | ||||
** Software or, alternatively, in accordance with the terms contained in | ||||
** a written agreement between you and The Qt Company. For licensing terms | ||||
Miikka Heikkinen
|
r2854 | ** and conditions see https://www.qt.io/terms-conditions. For further | ||
** information use the contact form at https://www.qt.io/contact-us. | ||||
** | ||||
** GNU General Public License Usage | ||||
** Alternatively, this file may be used under the terms of the GNU | ||||
** General Public License version 3 or (at your option) any later version | ||||
** approved by the KDE Free Qt Foundation. The licenses are as published by | ||||
** the Free Software Foundation and appearing in the file LICENSE.GPL3 | ||||
** included in the packaging of this file. Please review the following | ||||
** information to ensure the GNU General Public License requirements will | ||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html. | ||||
Marek Rosa
|
r1365 | ** | ||
Titta Heikkala
|
r2845 | ** $QT_END_LICENSE$ | ||
** | ||||
Miikka Heikkinen
|
r2854 | ****************************************************************************/ | ||
Marek Rosa
|
r1365 | |||
sauimone
|
r1263 | #ifndef MAINWIDGET_H | ||
#define MAINWIDGET_H | ||||
Titta Heikkala
|
r2714 | #include <QtCharts/QChartGlobal> | ||
#include <QtCharts/QChart> | ||||
#include <QtCharts/QChartView> | ||||
#include <QtWidgets/QWidget> | ||||
#include <QtWidgets/QGraphicsWidget> | ||||
#include <QtWidgets/QGridLayout> | ||||
#include <QtWidgets/QGraphicsGridLayout> | ||||
#include <QtWidgets/QDoubleSpinBox> | ||||
#include <QtWidgets/QGroupBox> | ||||
#include <QtCharts/QBarSeries> | ||||
sauimone
|
r1263 | |||
Titta Heikkala
|
r2712 | QT_CHARTS_USE_NAMESPACE | ||
sauimone
|
r1263 | |||
class MainWidget : public QWidget | ||||
{ | ||||
Q_OBJECT | ||||
public: | ||||
explicit MainWidget(QWidget *parent = 0); | ||||
void createSeries(); | ||||
sauimone
|
r1444 | void showLegendSpinbox(); | ||
void hideLegendSpinbox(); | ||||
Jani Honkonen
|
r2098 | public Q_SLOTS: | ||
Tero Ahola
|
r2034 | void toggleAttached(); | ||
sauimone
|
r1263 | void addBarset(); | ||
void removeBarset(); | ||||
Tero Ahola
|
r2034 | void setLegendAlignment(); | ||
sauimone
|
r1444 | |||
sauimone
|
r1522 | void toggleBold(); | ||
void toggleItalic(); | ||||
void fontSizeChanged(); | ||||
sauimone
|
r1444 | void updateLegendLayout(); | ||
sauimone
|
r1263 | private: | ||
QChart *m_chart; | ||||
sauimone
|
r1594 | QBarSeries *m_series; | ||
sauimone
|
r1263 | |||
QChartView *m_chartView; | ||||
QGridLayout *m_mainLayout; | ||||
QGridLayout *m_buttonLayout; | ||||
sauimone
|
r1522 | QGridLayout *m_fontLayout; | ||
QDoubleSpinBox *m_fontSize; | ||||
sauimone
|
r1263 | |||
sauimone
|
r1444 | // For detached layout | ||
Jani Honkonen
|
r2102 | QGroupBox *m_legendSettings; | ||
sauimone
|
r1444 | QDoubleSpinBox *m_legendPosX; | ||
QDoubleSpinBox *m_legendPosY; | ||||
QDoubleSpinBox *m_legendWidth; | ||||
QDoubleSpinBox *m_legendHeight; | ||||
sauimone
|
r1263 | }; | ||
#endif // MAINWIDGET_H | ||||