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