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