qpieseries.h
45 lines
| 1.0 KiB
| text/x-c
|
CLexer
/ src / qpieseries.h
|
r51 | #ifndef PIESERIES_H | ||
#define PIESERIES_H | ||||
#include "qchartseries.h" | ||||
#include <QObject> | ||||
#include <QRectF> | ||||
#include <QColor> | ||||
class QGraphicsObject; | ||||
QTCOMMERCIALCHART_BEGIN_NAMESPACE | ||||
class PieSlice; | ||||
class QTCOMMERCIALCHART_EXPORT QPieSeries : public QChartSeries | ||||
{ | ||||
Q_OBJECT | ||||
|
r60 | |||
|
r51 | public: | ||
// TODO: use a generic data class instead of x and y | ||||
|
r61 | QPieSeries(QGraphicsObject *parent = 0); | ||
|
r51 | ~QPieSeries(); | ||
QColor randomColor(); | ||||
|
r60 | void setSizeFactor(qreal sizeFactor); | ||
qreal sizeFactor() { return m_sizeFactor; } | ||||
|
r51 | |||
public: // from QChartSeries | ||||
QChartSeriesType type() const { return QChartSeries::SeriesTypePie; } | ||||
|
r61 | bool setData(QList<qreal> data); | ||
|
r51 | |||
public Q_SLOTS: | ||||
|
r54 | void chartSizeChanged(QRectF rect); | ||
|
r51 | |||
private: | ||||
|
r60 | void resizeSlices(QRectF rect); | ||
|
r51 | //Q_DECLARE_PRIVATE(QPieSeries) | ||
Q_DISABLE_COPY(QPieSeries) | ||||
// TODO: move the followin to internal impl | ||||
|
r61 | QList<qreal> m_data; | ||
|
r51 | QList<PieSlice*> m_slices; | ||
|
r60 | QRectF m_chartSize; | ||
qreal m_sizeFactor; | ||||
|
r51 | }; | ||
QTCOMMERCIALCHART_END_NAMESPACE | ||||
#endif // PIESERIES_H | ||||