qabstractseries.h
104 lines
| 2.9 KiB
| text/x-c
|
CLexer
|
r2845 | /****************************************************************************** | ||
|
r794 | ** | ||
|
r2845 | ** Copyright (C) 2015 The Qt Company Ltd. | ||
** Contact: http://www.qt.io/licensing/ | ||||
|
r794 | ** | ||
|
r2740 | ** This file is part of the Qt Charts module. | ||
|
r794 | ** | ||
|
r2845 | ** $QT_BEGIN_LICENSE:COMM$ | ||
|
r794 | ** | ||
|
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 | ||||
** and conditions see http://www.qt.io/terms-conditions. For further | ||||
** information use the contact form at http://www.qt.io/contact-us. | ||||
|
r794 | ** | ||
|
r2845 | ** $QT_END_LICENSE$ | ||
** | ||||
******************************************************************************/ | ||||
|
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) | ||
|
r2820 | Q_PROPERTY(bool useOpenGL READ useOpenGL WRITE setUseOpenGL NOTIFY useOpenGLChanged) | ||
|
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); | ||||
|
r2820 | void setUseOpenGL(bool enable = true); | ||
bool useOpenGL() const; | ||||
|
r2067 | |||
|
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(); | ||
|
r2820 | void useOpenGLChanged(); | ||
|
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; | ||
|
r2820 | friend class QAreaSeries; | ||
|
r23 | }; | ||
|
r2712 | QT_CHARTS_END_NAMESPACE | ||
|
r23 | |||
|
r2046 | #endif // QABSTRACTSERIES_H | ||