2018-10-29 00:11:23 +01:00
|
|
|
#ifndef TEXTPATHITEM_H
|
|
|
|
#define TEXTPATHITEM_H
|
|
|
|
|
|
|
|
#include <QFont>
|
|
|
|
#include <QString>
|
2018-11-11 14:10:38 +01:00
|
|
|
#include "textitem.h"
|
2018-10-29 00:11:23 +01:00
|
|
|
|
2018-11-11 14:10:38 +01:00
|
|
|
class TextPathItem : public TextItem
|
2018-10-29 00:11:23 +01:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
TextPathItem(const QString &text, const QPainterPath &path,
|
2018-11-11 14:10:38 +01:00
|
|
|
const QFont &font);
|
2018-10-29 00:11:23 +01:00
|
|
|
|
|
|
|
QPainterPath shape() const {return _shape;}
|
2018-11-11 14:10:38 +01:00
|
|
|
QRectF boundingRect() const {return _boundingRect;}
|
|
|
|
void paint(QPainter *painter) const;
|
2018-10-29 00:11:23 +01:00
|
|
|
|
|
|
|
void setPen(const QPen &pen) {_pen = pen;}
|
|
|
|
|
|
|
|
private:
|
|
|
|
QString _text;
|
|
|
|
QPainterPath _path;
|
|
|
|
QPainterPath _shape;
|
2018-11-11 14:10:38 +01:00
|
|
|
QRectF _boundingRect;
|
2018-10-29 00:11:23 +01:00
|
|
|
QFont _font;
|
|
|
|
QPen _pen;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // TEXTPATHITEM_H
|