pieslicelabel_p.h
57 lines
| 1.4 KiB
| text/x-c
|
CLexer
Jani Honkonen
|
r174 | #ifndef PIELABEL_H | ||
#define PIELABEL_H | ||||
#include "qchartglobal.h" | ||||
#include <QGraphicsItem> | ||||
#include <QPen> | ||||
Jani Honkonen
|
r181 | #include <QFontMetricsF> | ||
Jani Honkonen
|
r174 | |||
Jani Honkonen
|
r181 | class QGraphicsTextItem; | ||
Jani Honkonen
|
r174 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | ||
class PieSliceLabel : public QGraphicsItem | ||||
{ | ||||
public: | ||||
PieSliceLabel(QGraphicsItem* parent = 0); | ||||
Jani Honkonen
|
r181 | ~PieSliceLabel() {}; | ||
Jani Honkonen
|
r174 | |||
public: // from QGraphicsItem | ||||
Jani Honkonen
|
r181 | QRectF boundingRect() const { return m_rect; } | ||
Jani Honkonen
|
r174 | void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); | ||
public: | ||||
Jani Honkonen
|
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; } | ||||
Jani Honkonen
|
r174 | |||
private: | ||||
Jani Honkonen
|
r181 | QPointF m_armStartPoint; | ||
qreal m_armAngle; | ||||
qreal m_armLength; | ||||
QString m_text; | ||||
Jani Honkonen
|
r174 | QRectF m_rect; | ||
Jani Honkonen
|
r181 | QPainterPath m_armPath; | ||
QRectF m_textRect; | ||||
Jani Honkonen
|
r174 | QPen m_pen; | ||
Jani Honkonen
|
r181 | QFont m_font; | ||
Jani Honkonen
|
r174 | }; | ||
QTCOMMERCIALCHART_END_NAMESPACE | ||||
#endif // PIELABEL_H | ||||