piepresenter.h
43 lines
| 963 B
| text/x-c
|
CLexer
Jani Honkonen
|
r146 | #ifndef PIEPRESENTER_H | ||
#define PIEPRESENTER_H | ||||
Jani Honkonen
|
r142 | |||
#include "chartitem_p.h" | ||||
#include "qpieseries.h" | ||||
class QGraphicsItem; | ||||
QTCOMMERCIALCHART_BEGIN_NAMESPACE | ||||
class PieSlice; | ||||
Jani Honkonen
|
r146 | class PiePresenter : public QObject, public ChartItem | ||
Jani Honkonen
|
r142 | { | ||
Q_OBJECT | ||||
public: | ||||
// TODO: use a generic data class instead of x and y | ||||
Jani Honkonen
|
r146 | PiePresenter(QGraphicsItem *parent, QPieSeries *series); | ||
~PiePresenter(); | ||||
Jani Honkonen
|
r142 | |||
public: // from ChartItem | ||||
QRectF boundingRect() const { return m_rect; } | ||||
void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *) {} | ||||
public: | ||||
void seriesChanged(); | ||||
void resize(); | ||||
QRectF pieRect() const { return m_pieRect; } | ||||
public Q_SLOTS: | ||||
void handleDomainChanged(const Domain& domain); | ||||
void handleGeometryChanged(const QRectF& rect); | ||||
private: | ||||
friend class PieSlice; | ||||
QList<PieSlice*> m_slices; | ||||
QPieSeries *m_pieSeries; | ||||
QRectF m_rect; | ||||
QRectF m_pieRect; | ||||
}; | ||||
QTCOMMERCIALCHART_END_NAMESPACE | ||||
Jani Honkonen
|
r146 | #endif // PIEPRESENTER_H | ||