##// END OF EJS Templates
Adds preseterchart example
Adds preseterchart example

File last commit:

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