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