qabstractseries.h
96 lines
| 2.6 KiB
| text/x-c
|
CLexer
|
r794 | /**************************************************************************** | ||
** | ||||
|
r2688 | ** Copyright (C) 2014 Digia Plc | ||
|
r794 | ** All rights reserved. | ||
|
r2740 | ** For any questions to Digia, please use contact form at http://qt.io | ||
|
r794 | ** | ||
|
r2740 | ** This file is part of the Qt Charts module. | ||
|
r794 | ** | ||
|
r2740 | ** Licensees holding valid commercial license for Qt may use this file in | ||
** accordance with the Qt License Agreement provided with the Software | ||||
** or, alternatively, in accordance with the terms contained in a written | ||||
** agreement between you and Digia. | ||||
|
r794 | ** | ||
** If you have questions regarding the use of this file, please use | ||||
|
r2740 | ** contact form at http://qt.io | ||
|
r794 | ** | ||
****************************************************************************/ | ||||
|
r988 | #ifndef QABSTRACTSERIES_H | ||
#define QABSTRACTSERIES_H | ||||
|
r23 | |||
|
r2714 | #include <QtCharts/QChartGlobal> | ||
#include <QtCharts/QAbstractAxis> | ||||
#include <QtCore/QObject> | ||||
#include <QtGui/QPen> | ||||
|
r23 | |||
|
r2712 | QT_CHARTS_BEGIN_NAMESPACE | ||
|
r23 | |||
|
r988 | class QAbstractSeriesPrivate; | ||
|
r1062 | class QChart; | ||
|
r938 | |||
|
r2712 | class QT_CHARTS_EXPORT QAbstractSeries : public QObject | ||
|
r23 | { | ||
|
r71 | Q_OBJECT | ||
|
r1328 | Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged) | ||
|
r1342 | Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged) | ||
|
r2067 | Q_PROPERTY(qreal opacity READ opacity WRITE setOpacity NOTIFY opacityChanged) | ||
|
r1462 | Q_PROPERTY(SeriesType type READ type) | ||
|
r1107 | Q_ENUMS(SeriesType) | ||
|
r884 | |||
|
r23 | public: | ||
|
r1107 | enum SeriesType { | ||
|
r120 | SeriesTypeLine, | ||
|
r309 | SeriesTypeArea, | ||
|
r56 | SeriesTypeBar, | ||
|
r94 | SeriesTypeStackedBar, | ||
|
r101 | SeriesTypePercentBar, | ||
|
r51 | SeriesTypePie, | ||
|
r309 | SeriesTypeScatter, | ||
|
r1672 | SeriesTypeSpline, | ||
|
r1687 | SeriesTypeHorizontalBar, | ||
|
r1686 | SeriesTypeHorizontalStackedBar, | ||
|
r2548 | SeriesTypeHorizontalPercentBar, | ||
SeriesTypeBoxPlot | ||||
|
r30 | }; | ||
|
r23 | |||
protected: | ||||
|
r988 | QAbstractSeries(QAbstractSeriesPrivate &d, QObject *parent = 0); | ||
|
r23 | |||
public: | ||||
|
r988 | ~QAbstractSeries(); | ||
|
r1107 | virtual SeriesType type() const = 0; | ||
|
r1588 | |||
|
r2104 | void setName(const QString &name); | ||
|
r938 | QString name() const; | ||
|
r1342 | void setVisible(bool visible = true); | ||
bool isVisible() const; | ||||
|
r2067 | qreal opacity() const; | ||
void setOpacity(qreal opacity); | ||||
|
r2104 | QChart *chart() const; | ||
|
r405 | |||
|
r2548 | bool attachAxis(QAbstractAxis *axis); | ||
bool detachAxis(QAbstractAxis *axis); | ||||
|
r2273 | QList<QAbstractAxis*> attachedAxes(); | ||
|
r1552 | void show(); | ||
void hide(); | ||||
|
r1328 | Q_SIGNALS: | ||
void nameChanged(); | ||||
|
r1342 | void visibleChanged(); | ||
|
r2067 | void opacityChanged(); | ||
|
r1328 | |||
|
r597 | protected: | ||
|
r988 | QScopedPointer<QAbstractSeriesPrivate> d_ptr; | ||
|
r943 | friend class ChartDataSet; | ||
friend class ChartPresenter; | ||||
|
r2273 | friend class ChartThemeManager; | ||
|
r950 | friend class QLegendPrivate; | ||
|
r1813 | friend class DeclarativeChart; | ||
|
r23 | }; | ||
|
r2712 | QT_CHARTS_END_NAMESPACE | ||
|
r23 | |||
|
r2046 | #endif // QABSTRACTSERIES_H | ||