pieslice.h
60 lines
| 1.2 KiB
| text/x-c
|
CLexer
Tero Ahola
|
r51 | #ifndef PIESLICE_H | ||
#define PIESLICE_H | ||||
#include "qchartglobal.h" | ||||
Tero Ahola
|
r103 | #include "charttheme_p.h" | ||
Jani Honkonen
|
r157 | #include "qpieseries.h" | ||
Tero Ahola
|
r51 | #include <QGraphicsItem> | ||
#include <QRectF> | ||||
#include <QColor> | ||||
Jani Honkonen
|
r157 | #include <QPen> | ||
Tero Ahola
|
r51 | |||
QTCOMMERCIALCHART_BEGIN_NAMESPACE | ||||
Jani Honkonen
|
r146 | class PiePresenter; | ||
Jani Honkonen
|
r174 | class PieSliceLabel; | ||
Jani Honkonen
|
r203 | class QPieSlice; | ||
Tero Ahola
|
r51 | |||
Jani Honkonen
|
r174 | class PieSlice : public QGraphicsObject | ||
Tero Ahola
|
r51 | { | ||
Jani Honkonen
|
r174 | Q_OBJECT | ||
Tero Ahola
|
r51 | public: | ||
Jani Honkonen
|
r203 | PieSlice(QGraphicsItem* parent = 0); | ||
Tero Ahola
|
r51 | ~PieSlice(); | ||
public: // from QGraphicsItem | ||||
QRectF boundingRect() const; | ||||
QPainterPath shape() const; | ||||
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); | ||||
Jani Honkonen
|
r142 | void hoverEnterEvent(QGraphicsSceneHoverEvent *event); | ||
Jani Honkonen
|
r157 | void hoverLeaveEvent(QGraphicsSceneHoverEvent *event); | ||
Jani Honkonen
|
r142 | void mousePressEvent(QGraphicsSceneMouseEvent *event); | ||
Tero Ahola
|
r51 | |||
Jani Honkonen
|
r174 | Q_SIGNALS: | ||
void clicked(); | ||||
Jani Honkonen
|
r203 | void hoverEnter(); | ||
void hoverLeave(); | ||||
Jani Honkonen
|
r157 | |||
Jani Honkonen
|
r203 | public Q_SLOTS: | ||
void handleSliceDataChanged(); | ||||
void setPieRect(QRectF rect); | ||||
void updateGeometry(); | ||||
void updateData(const QPieSlice *sliceData); | ||||
Jani Honkonen
|
r157 | |||
Jani Honkonen
|
r142 | private: | ||
Jani Honkonen
|
r174 | PieSliceLabel* m_slicelabel; | ||
Jani Honkonen
|
r203 | |||
QRectF m_pieRect; | ||||
Jani Honkonen
|
r157 | QPainterPath m_path; | ||
Jani Honkonen
|
r203 | |||
qreal m_angle; | ||||
qreal m_span; | ||||
bool m_isExploded; | ||||
QPen m_pen; | ||||
QBrush m_brush; | ||||
Tero Ahola
|
r51 | }; | ||
QTCOMMERCIALCHART_END_NAMESPACE | ||||
#endif // PIESLICE_H | ||||