qpieseries.h
80 lines
| 2.0 KiB
| text/x-c
|
CLexer
Jani Honkonen
|
r142 | #ifndef PIESERIES_H | ||
#define PIESERIES_H | ||||
Jani Honkonen
|
r669 | #include <qseries.h> | ||
Jani Honkonen
|
r142 | |||
QTCOMMERCIALCHART_BEGIN_NAMESPACE | ||||
Jani Honkonen
|
r669 | class QPieSeriesPrivate; | ||
Jani Honkonen
|
r203 | class QPieSlice; | ||
Jani Honkonen
|
r157 | |||
Michal Klocek
|
r360 | class QTCOMMERCIALCHART_EXPORT QPieSeries : public QSeries | ||
Jani Honkonen
|
r142 | { | ||
Q_OBJECT | ||||
public: | ||||
QPieSeries(QObject *parent = 0); | ||||
Jani Honkonen
|
r203 | virtual ~QPieSeries(); | ||
Jani Honkonen
|
r142 | |||
public: // from QChartSeries | ||||
Michal Klocek
|
r360 | QSeriesType type() const; | ||
Jani Honkonen
|
r142 | |||
public: | ||||
Jani Honkonen
|
r437 | |||
// slice setters | ||||
Jani Honkonen
|
r203 | void add(QPieSlice* slice); | ||
Jani Honkonen
|
r437 | void add(QList<QPieSlice*> slices); | ||
Marek Rosa
|
r604 | void insert(int i, QPieSlice* slice); | ||
Jani Honkonen
|
r437 | void replace(QList<QPieSlice*> slices); | ||
Jani Honkonen
|
r203 | void remove(QPieSlice* slice); | ||
void clear(); | ||||
Jani Honkonen
|
r142 | |||
Jani Honkonen
|
r669 | // slice getters | ||
Jani Honkonen
|
r314 | QList<QPieSlice*> slices() const; | ||
Jani Honkonen
|
r174 | |||
Jani Honkonen
|
r437 | // calculated data | ||
int count() const; | ||||
Jani Honkonen
|
r621 | bool isEmpty() const; | ||
Jani Honkonen
|
r437 | qreal total() const; | ||
// pie customization | ||||
Jani Honkonen
|
r498 | void setPiePosition(qreal relativeHorizontalPosition, qreal relativeVerticalPosition); | ||
qreal pieHorizontalPosition() const; | ||||
qreal pieVerticalPosition() const; | ||||
void setPieSize(qreal relativeSize); | ||||
qreal pieSize() const; | ||||
void setPieStartAngle(qreal startAngle); | ||||
qreal pieStartAngle() const; | ||||
void setPieEndAngle(qreal endAngle); | ||||
qreal pieEndAngle() const; | ||||
Jani Honkonen
|
r203 | |||
Jani Honkonen
|
r437 | // convenience function | ||
QPieSeries& operator << (QPieSlice* slice); | ||||
QPieSlice* add(qreal value, QString name); | ||||
Jani Honkonen
|
r386 | void setLabelsVisible(bool visible = true); | ||
Jani Honkonen
|
r203 | |||
Marek Rosa
|
r597 | // data from model | ||
bool setModel(QAbstractItemModel* model); | ||||
void setModelMapping(int modelValuesLine, int modelLabelsLine, Qt::Orientation orientation = Qt::Vertical); | ||||
Jani Honkonen
|
r157 | Q_SIGNALS: | ||
Jani Honkonen
|
r203 | void clicked(QPieSlice* slice); | ||
void hoverEnter(QPieSlice* slice); | ||||
void hoverLeave(QPieSlice* slice); | ||||
Jani Honkonen
|
r621 | void added(QList<QPieSlice*> slices); | ||
void removed(QList<QPieSlice*> slices); | ||||
void piePositionChanged(); | ||||
void pieSizeChanged(); | ||||
Jani Honkonen
|
r181 | |||
Jani Honkonen
|
r174 | private: | ||
Jani Honkonen
|
r669 | QPieSeriesPrivate * const d_ptr; | ||
Q_DECLARE_PRIVATE(QPieSeries) | ||||
Q_DISABLE_COPY(QPieSeries) | ||||
Jani Honkonen
|
r676 | |||
public: | ||||
typedef QPieSeriesPrivate * const DataPtr; | ||||
inline DataPtr &data_ptr() { return d_ptr; } | ||||
Jani Honkonen
|
r142 | }; | ||
QTCOMMERCIALCHART_END_NAMESPACE | ||||
#endif // PIESERIES_H | ||||