qpieseries.h
92 lines
| 2.8 KiB
| text/x-c
|
CLexer
|
r794 | /**************************************************************************** | ||
** | ||||
** Copyright (C) 2012 Digia Plc | ||||
** All rights reserved. | ||||
** For any questions to Digia, please use contact form at http://qt.digia.com | ||||
** | ||||
** This file is part of the Qt Commercial Charts Add-on. | ||||
** | ||||
** $QT_BEGIN_LICENSE$ | ||||
** Licensees holding valid Qt Commercial licenses may use this file in | ||||
** accordance with the Qt Commercial License Agreement provided with the | ||||
** Software or, alternatively, in accordance with the terms contained in | ||||
** a written agreement between you and Digia. | ||||
** | ||||
** If you have questions regarding the use of this file, please use | ||||
** contact form at http://qt.digia.com | ||||
** $QT_END_LICENSE$ | ||||
** | ||||
****************************************************************************/ | ||||
|
r142 | #ifndef PIESERIES_H | ||
#define PIESERIES_H | ||||
|
r988 | #include <qabstractseries.h> | ||
|
r142 | |||
QTCOMMERCIALCHART_BEGIN_NAMESPACE | ||||
|
r669 | class QPieSeriesPrivate; | ||
|
r203 | class QPieSlice; | ||
|
r1164 | class QPieModelMapper; | ||
|
r157 | |||
|
r988 | class QTCOMMERCIALCHART_EXPORT QPieSeries : public QAbstractSeries | ||
|
r142 | { | ||
Q_OBJECT | ||||
|
r884 | 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) | ||||
|
r1169 | Q_PROPERTY(int count READ count) | ||
Q_PROPERTY(QPieModelMapper *modelMapper READ modelMapper) | ||||
|
r142 | |||
public: | ||||
|
r970 | explicit QPieSeries(QObject *parent = 0); | ||
|
r203 | virtual ~QPieSeries(); | ||
|
r142 | |||
|
r1107 | QAbstractSeries::SeriesType type() const; | ||
|
r142 | |||
|
r1104 | bool append(QPieSlice* slice); | ||
bool append(QList<QPieSlice*> slices); | ||||
|
r1009 | QPieSeries& operator << (QPieSlice* slice); | ||
QPieSlice* append(qreal value, QString name); | ||||
|
r1104 | bool insert(int index, QPieSlice* slice); | ||
bool remove(QPieSlice* slice); | ||||
|
r203 | void clear(); | ||
|
r142 | |||
|
r314 | QList<QPieSlice*> slices() const; | ||
|
r437 | int count() const; | ||
|
r621 | bool isEmpty() const; | ||
|
r1009 | |||
|
r939 | qreal sum() const; | ||
|
r437 | |||
|
r884 | void setHorizontalPosition(qreal relativePosition); | ||
qreal horizontalPosition() const; | ||||
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; | ||||
void setPieEndAngle(qreal endAngle); | ||||
qreal pieEndAngle() const; | ||||
|
r203 | |||
|
r386 | void setLabelsVisible(bool visible = true); | ||
|
r203 | |||
|
r1164 | void setModel(QAbstractItemModel* model); | ||
void setModelMapper(QPieModelMapper *mapper); | ||||
QPieModelMapper* modelMapper() const; | ||||
|
r597 | |||
|
r157 | Q_SIGNALS: | ||
|
r1009 | void clicked(QPieSlice* slice); | ||
void hovered(QPieSlice* slice, bool state); | ||||
|
r181 | |||
|
r174 | private: | ||
|
r669 | Q_DECLARE_PRIVATE(QPieSeries) | ||
Q_DISABLE_COPY(QPieSeries) | ||||
|
r142 | }; | ||
QTCOMMERCIALCHART_END_NAMESPACE | ||||
#endif // PIESERIES_H | ||||