2019-05-10 18:56:19 +02:00
|
|
|
#ifndef TEXTPATHITEM_H
|
|
|
|
#define TEXTPATHITEM_H
|
|
|
|
|
2019-06-07 20:33:08 +02:00
|
|
|
#include "textitem.h"
|
2019-05-10 18:56:19 +02:00
|
|
|
|
2023-06-06 07:18:31 +02:00
|
|
|
class QFont;
|
|
|
|
class QImage;
|
|
|
|
class QColor;
|
|
|
|
|
2019-06-07 20:33:08 +02:00
|
|
|
class TextPathItem : public TextItem
|
2019-05-10 18:56:19 +02:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
TextPathItem(const QPolygonF &line, const QString *label,
|
2022-11-04 09:03:36 +01:00
|
|
|
const QRect &tileRect, const QFont *font, const QColor *color,
|
2023-06-06 07:18:31 +02:00
|
|
|
const QColor *haloColor, const QImage *img = 0, bool rotate = true);
|
2021-04-10 15:27:40 +02:00
|
|
|
TextPathItem(const QPainterPath &line, const QString *label,
|
|
|
|
const QRect &tileRect, const QFont *font, const QColor *color,
|
2023-06-06 07:18:31 +02:00
|
|
|
const QColor *haloColor, const QImage *img = 0, bool rotate = true);
|
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:
|
2023-06-04 23:56:00 +02:00
|
|
|
template<class T> void init(const T &line, const QRect &tileRect);
|
|
|
|
|
2019-05-10 18:56:19 +02:00
|
|
|
const QFont *_font;
|
2023-06-06 07:18:31 +02:00
|
|
|
const QColor *_color, *_haloColor;
|
2023-06-04 23:56:00 +02:00
|
|
|
const QImage *_img;
|
2019-05-10 18:56:19 +02:00
|
|
|
QRectF _rect;
|
2023-06-06 07:18:31 +02:00
|
|
|
QPainterPath _path, _shape;
|
|
|
|
bool _rotate, _reverse;
|
2019-05-10 18:56:19 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // TEXTPATHITEM_H
|