qpieseries.h
115 lines
| 3.7 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 | |||
Jani Honkonen
|
r2046 | #ifndef QPIESERIES_H | ||
#define QPIESERIES_H | ||||
Jani Honkonen
|
r142 | |||
Titta Heikkala
|
r2714 | #include <QtCharts/QAbstractSeries> | ||
Titta Heikkala
|
r2712 | #include <QtCharts/QPieSlice> | ||
Jani Honkonen
|
r142 | |||
Titta Heikkala
|
r2712 | QT_CHARTS_BEGIN_NAMESPACE | ||
Jani Honkonen
|
r669 | class QPieSeriesPrivate; | ||
Jani Honkonen
|
r157 | |||
Titta Heikkala
|
r2712 | class QT_CHARTS_EXPORT QPieSeries : public QAbstractSeries | ||
Jani Honkonen
|
r142 | { | ||
Q_OBJECT | ||||
Tero Ahola
|
r1482 | Q_PROPERTY(qreal horizontalPosition READ horizontalPosition WRITE setHorizontalPosition) | ||
Q_PROPERTY(qreal verticalPosition READ verticalPosition WRITE setVerticalPosition) | ||||
Q_PROPERTY(qreal size READ pieSize WRITE setPieSize) | ||||
Q_PROPERTY(qreal startAngle READ pieStartAngle WRITE setPieStartAngle) | ||||
Q_PROPERTY(qreal endAngle READ pieEndAngle WRITE setPieEndAngle) | ||||
Jani Honkonen
|
r1255 | Q_PROPERTY(int count READ count NOTIFY countChanged) | ||
Q_PROPERTY(qreal sum READ sum NOTIFY sumChanged) | ||||
Marek Rosa
|
r1838 | Q_PROPERTY(qreal holeSize READ holeSize WRITE setHoleSize) | ||
Jani Honkonen
|
r142 | |||
public: | ||||
Marc Mutz
|
r2871 | explicit QPieSeries(QObject *parent = Q_NULLPTR); | ||
Jani Honkonen
|
r203 | virtual ~QPieSeries(); | ||
Jani Honkonen
|
r142 | |||
Michal Klocek
|
r1107 | QAbstractSeries::SeriesType type() const; | ||
Jani Honkonen
|
r142 | |||
Jani Honkonen
|
r2104 | bool append(QPieSlice *slice); | ||
bool append(QList<QPieSlice *> slices); | ||||
QPieSeries &operator << (QPieSlice *slice); | ||||
QPieSlice *append(QString label, qreal value); | ||||
Jani Honkonen
|
r1255 | |||
Jani Honkonen
|
r2104 | bool insert(int index, QPieSlice *slice); | ||
Jani Honkonen
|
r1255 | |||
Jani Honkonen
|
r2104 | bool remove(QPieSlice *slice); | ||
bool take(QPieSlice *slice); | ||||
Jani Honkonen
|
r203 | void clear(); | ||
Jani Honkonen
|
r142 | |||
Jani Honkonen
|
r2104 | QList<QPieSlice *> slices() const; | ||
Jani Honkonen
|
r437 | int count() const; | ||
Jani Honkonen
|
r1255 | |||
Jani Honkonen
|
r621 | bool isEmpty() const; | ||
Jani Honkonen
|
r1009 | |||
Jani Honkonen
|
r939 | qreal sum() const; | ||
Jani Honkonen
|
r437 | |||
Marek Rosa
|
r1838 | void setHoleSize(qreal holeSize); | ||
qreal holeSize() const; | ||||
Marek Rosa
|
r1671 | |||
Tero Ahola
|
r884 | void setHorizontalPosition(qreal relativePosition); | ||
qreal horizontalPosition() const; | ||||
Jani Honkonen
|
r1255 | |||
Tero Ahola
|
r884 | void setVerticalPosition(qreal relativePosition); | ||
qreal verticalPosition() const; | ||||
Jani Honkonen
|
r1009 | |||
Jani Honkonen
|
r498 | void setPieSize(qreal relativeSize); | ||
qreal pieSize() const; | ||||
Jani Honkonen
|
r1009 | |||
Jani Honkonen
|
r498 | void setPieStartAngle(qreal startAngle); | ||
qreal pieStartAngle() const; | ||||
Jani Honkonen
|
r1255 | |||
Jani Honkonen
|
r498 | void setPieEndAngle(qreal endAngle); | ||
qreal pieEndAngle() const; | ||||
Jani Honkonen
|
r203 | |||
Jani Honkonen
|
r386 | void setLabelsVisible(bool visible = true); | ||
Marek Rosa
|
r1712 | void setLabelsPosition(QPieSlice::LabelPosition position); | ||
Jani Honkonen
|
r203 | |||
Jani Honkonen
|
r157 | Q_SIGNALS: | ||
Jani Honkonen
|
r2104 | void added(QList<QPieSlice *> slices); | ||
void removed(QList<QPieSlice *> slices); | ||||
void clicked(QPieSlice *slice); | ||||
void hovered(QPieSlice *slice, bool state); | ||||
Titta Heikkala
|
r2739 | void pressed(QPieSlice *slice); | ||
void released(QPieSlice *slice); | ||||
void doubleClicked(QPieSlice *slice); | ||||
Jani Honkonen
|
r1255 | void countChanged(); | ||
void sumChanged(); | ||||
Jani Honkonen
|
r181 | |||
Jani Honkonen
|
r174 | private: | ||
Jani Honkonen
|
r669 | Q_DECLARE_PRIVATE(QPieSeries) | ||
Q_DISABLE_COPY(QPieSeries) | ||||
Michal Klocek
|
r2273 | friend class PieChartItem; | ||
Jani Honkonen
|
r142 | }; | ||
Titta Heikkala
|
r2712 | QT_CHARTS_END_NAMESPACE | ||
Jani Honkonen
|
r142 | |||
Jani Honkonen
|
r2046 | #endif // QPIESERIES_H | ||