1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-25 04:05:53 +01:00
GPXSee/src/map/textpathitem.h

38 lines
990 B
C
Raw Normal View History

2019-05-10 18:56:19 +02:00
#ifndef TEXTPATHITEM_H
#define TEXTPATHITEM_H
#include "textitem.h"
2019-05-10 18:56:19 +02:00
class QFont;
class QImage;
class QColor;
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,
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,
const QColor *haloColor, const QImage *img = 0, bool rotate = true);
2019-05-10 18:56:19 +02:00
bool isValid() const {return !_path.isEmpty();}
QPainterPath shape() const {return _shape;}
QRectF boundingRect() const {return _rect;}
2019-05-10 18:56:19 +02:00
void paint(QPainter *painter) const;
private:
template<class T> void init(const T &line, const QRect &tileRect);
2019-05-10 18:56:19 +02:00
const QFont *_font;
const QColor *_color, *_haloColor;
const QImage *_img;
2019-05-10 18:56:19 +02:00
QRectF _rect;
QPainterPath _path, _shape;
bool _rotate, _reverse;
2019-05-10 18:56:19 +02:00
};
#endif // TEXTPATHITEM_H