2019-05-10 18:56:19 +02:00
|
|
|
#ifndef TEXTPATHITEM_H
|
|
|
|
#define TEXTPATHITEM_H
|
|
|
|
|
|
|
|
#include <QVector>
|
|
|
|
#include <QPainterPath>
|
2019-06-07 20:33:08 +02:00
|
|
|
#include "textitem.h"
|
2019-05-10 18:56:19 +02:00
|
|
|
|
2019-06-07 20:33:08 +02:00
|
|
|
class TextPathItem : public TextItem
|
2019-05-10 18:56:19 +02:00
|
|
|
{
|
|
|
|
public:
|
2020-10-17 14:26:59 +02:00
|
|
|
TextPathItem() : TextItem(0), _font(0), _color(0) {}
|
2019-05-10 18:56:19 +02:00
|
|
|
TextPathItem(const QPolygonF &line, const QString *label,
|
2022-11-04 09:03:36 +01:00
|
|
|
const QRect &tileRect, const QFont *font, const QColor *color,
|
|
|
|
const QColor *haloColor);
|
2021-04-10 15:27:40 +02:00
|
|
|
TextPathItem(const QPainterPath &line, const QString *label,
|
|
|
|
const QRect &tileRect, const QFont *font, const QColor *color,
|
2021-04-18 12:20:07 +02:00
|
|
|
const QColor *haloColor);
|
2019-05-10 18:56:19 +02:00
|
|
|
|
|
|
|
bool isValid() const {return !_path.isEmpty();}
|
2019-06-07 20:33:08 +02:00
|
|
|
|
|
|
|
QPainterPath shape() const {return _shape;}
|
|
|
|
QRectF boundingRect() const {return _rect;}
|
2019-05-10 18:56:19 +02:00
|
|
|
void paint(QPainter *painter) const;
|
|
|
|
|
|
|
|
private:
|
|
|
|
const QFont *_font;
|
|
|
|
const QColor *_color;
|
2021-04-18 12:20:07 +02:00
|
|
|
const QColor *_haloColor;
|
2019-05-10 18:56:19 +02:00
|
|
|
QPainterPath _path;
|
|
|
|
QRectF _rect;
|
|
|
|
QPainterPath _shape;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // TEXTPATHITEM_H
|