qabstractseries.h
112 lines
| 3.4 KiB
| text/x-c
|
CLexer
Miikka Heikkinen
|
r2854 | /**************************************************************************** | ||
Jani Honkonen
|
r794 | ** | ||
Miikka Heikkinen
|
r2854 | ** Copyright (C) 2016 The Qt Company Ltd. | ||
** Contact: https://www.qt.io/licensing/ | ||||
Jani Honkonen
|
r794 | ** | ||
Miikka Heikkinen
|
r2854 | ** This file is part of the Qt Charts module of the Qt Toolkit. | ||
Jani Honkonen
|
r794 | ** | ||
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. | ||||
Jani Honkonen
|
r794 | ** | ||
Titta Heikkala
|
r2845 | ** $QT_END_LICENSE$ | ||
** | ||||
Miikka Heikkinen
|
r2854 | ****************************************************************************/ | ||
Jani Honkonen
|
r794 | |||
Tero Ahola
|
r988 | #ifndef QABSTRACTSERIES_H | ||
#define QABSTRACTSERIES_H | ||||
Michal Klocek
|
r23 | |||
Titta Heikkala
|
r2714 | #include <QtCharts/QChartGlobal> | ||
#include <QtCharts/QAbstractAxis> | ||||
#include <QtCore/QObject> | ||||
#include <QtGui/QPen> | ||||
Michal Klocek
|
r23 | |||
Titta Heikkala
|
r2712 | QT_CHARTS_BEGIN_NAMESPACE | ||
Michal Klocek
|
r23 | |||
Tero Ahola
|
r988 | class QAbstractSeriesPrivate; | ||
Michal Klocek
|
r1062 | class QChart; | ||
Michal Klocek
|
r938 | |||
Titta Heikkala
|
r2712 | class QT_CHARTS_EXPORT QAbstractSeries : public QObject | ||
Michal Klocek
|
r23 | { | ||
sauimone
|
r71 | Q_OBJECT | ||
Tero Ahola
|
r1328 | Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged) | ||
Tero Ahola
|
r1342 | Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged) | ||
Tero Ahola
|
r2067 | Q_PROPERTY(qreal opacity READ opacity WRITE setOpacity NOTIFY opacityChanged) | ||
Tero Ahola
|
r1462 | Q_PROPERTY(SeriesType type READ type) | ||
Miikka Heikkinen
|
r2820 | Q_PROPERTY(bool useOpenGL READ useOpenGL WRITE setUseOpenGL NOTIFY useOpenGLChanged) | ||
Michal Klocek
|
r1107 | Q_ENUMS(SeriesType) | ||
Tero Ahola
|
r884 | |||
Michal Klocek
|
r23 | public: | ||
Michal Klocek
|
r1107 | enum SeriesType { | ||
Tero Ahola
|
r120 | SeriesTypeLine, | ||
Tero Ahola
|
r309 | SeriesTypeArea, | ||
sauimone
|
r56 | SeriesTypeBar, | ||
sauimone
|
r94 | SeriesTypeStackedBar, | ||
sauimone
|
r101 | SeriesTypePercentBar, | ||
Tero Ahola
|
r51 | SeriesTypePie, | ||
Tero Ahola
|
r309 | SeriesTypeScatter, | ||
sauimone
|
r1672 | SeriesTypeSpline, | ||
sauimone
|
r1687 | SeriesTypeHorizontalBar, | ||
sauimone
|
r1686 | SeriesTypeHorizontalStackedBar, | ||
Mika Salmela
|
r2548 | SeriesTypeHorizontalPercentBar, | ||
SeriesTypeBoxPlot | ||||
Tero Ahola
|
r30 | }; | ||
Michal Klocek
|
r23 | |||
protected: | ||||
Tero Ahola
|
r988 | QAbstractSeries(QAbstractSeriesPrivate &d, QObject *parent = 0); | ||
Michal Klocek
|
r23 | |||
public: | ||||
Tero Ahola
|
r988 | ~QAbstractSeries(); | ||
Michal Klocek
|
r1107 | virtual SeriesType type() const = 0; | ||
Michal Klocek
|
r1588 | |||
Jani Honkonen
|
r2104 | void setName(const QString &name); | ||
Michal Klocek
|
r938 | QString name() const; | ||
Tero Ahola
|
r1342 | void setVisible(bool visible = true); | ||
bool isVisible() const; | ||||
Tero Ahola
|
r2067 | qreal opacity() const; | ||
void setOpacity(qreal opacity); | ||||
Miikka Heikkinen
|
r2820 | void setUseOpenGL(bool enable = true); | ||
bool useOpenGL() const; | ||||
Tero Ahola
|
r2067 | |||
Jani Honkonen
|
r2104 | QChart *chart() const; | ||
Jani Honkonen
|
r405 | |||
Mika Salmela
|
r2548 | bool attachAxis(QAbstractAxis *axis); | ||
bool detachAxis(QAbstractAxis *axis); | ||||
Michal Klocek
|
r2273 | QList<QAbstractAxis*> attachedAxes(); | ||
Michal Klocek
|
r1552 | void show(); | ||
void hide(); | ||||
Tero Ahola
|
r1328 | Q_SIGNALS: | ||
void nameChanged(); | ||||
Tero Ahola
|
r1342 | void visibleChanged(); | ||
Tero Ahola
|
r2067 | void opacityChanged(); | ||
Miikka Heikkinen
|
r2820 | void useOpenGLChanged(); | ||
Tero Ahola
|
r1328 | |||
Marek Rosa
|
r597 | protected: | ||
Tero Ahola
|
r988 | QScopedPointer<QAbstractSeriesPrivate> d_ptr; | ||
Michal Klocek
|
r943 | friend class ChartDataSet; | ||
friend class ChartPresenter; | ||||
Michal Klocek
|
r2273 | friend class ChartThemeManager; | ||
Michal Klocek
|
r950 | friend class QLegendPrivate; | ||
Tero Ahola
|
r1813 | friend class DeclarativeChart; | ||
Miikka Heikkinen
|
r2820 | friend class QAreaSeries; | ||
Michal Klocek
|
r23 | }; | ||
Titta Heikkala
|
r2712 | QT_CHARTS_END_NAMESPACE | ||
Michal Klocek
|
r23 | |||
Jani Honkonen
|
r2046 | #endif // QABSTRACTSERIES_H | ||