pieslicelabel_p.h
57 lines
| 1.4 KiB
| text/x-c
|
CLexer
|
r174 | #ifndef PIELABEL_H | ||
#define PIELABEL_H | ||||
#include "qchartglobal.h" | ||||
#include <QGraphicsItem> | ||||
#include <QPen> | ||||
|
r181 | #include <QFontMetricsF> | ||
|
r174 | |||
|
r181 | class QGraphicsTextItem; | ||
|
r174 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | ||
class PieSliceLabel : public QGraphicsItem | ||||
{ | ||||
public: | ||||
PieSliceLabel(QGraphicsItem* parent = 0); | ||||
|
r181 | ~PieSliceLabel() {}; | ||
|
r174 | |||
public: // from QGraphicsItem | ||||
|
r181 | QRectF boundingRect() const { return m_rect; } | ||
|
r174 | void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); | ||
public: | ||||
|
r181 | void updateGeometry(); | ||
void setArmStartPoint(QPointF point) { m_armStartPoint = point; } | ||||
QPointF armStartPoint() const { return m_armStartPoint; } | ||||
void setArmAngle(qreal angle) { m_armAngle = angle; } | ||||
qreal armAngle() const { return m_armAngle; } | ||||
void setArmLength(qreal len) { m_armLength = len; } | ||||
qreal armLength() const { return m_armLength; } | ||||
void setText(QString text) { m_text = text; } | ||||
QString text() const { return m_text; } | ||||
void setPen(QPen pen) { m_pen = pen; } | ||||
QPen pen() const { return m_pen; } | ||||
void setFont(QFont font) { m_font = font; } | ||||
QFont font() const { return m_font; } | ||||
|
r174 | |||
private: | ||||
|
r181 | QPointF m_armStartPoint; | ||
qreal m_armAngle; | ||||
qreal m_armLength; | ||||
QString m_text; | ||||
|
r174 | QRectF m_rect; | ||
|
r181 | QPainterPath m_armPath; | ||
QRectF m_textRect; | ||||
|
r174 | QPen m_pen; | ||
|
r181 | QFont m_font; | ||
|
r174 | }; | ||
QTCOMMERCIALCHART_END_NAMESPACE | ||||
#endif // PIELABEL_H | ||||