1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2025-02-26 12:10:49 +01:00
GPXSee/src/map/textpointitem.h

35 lines
801 B
C
Raw Normal View History

2019-05-10 18:56:19 +02:00
#ifndef TEXTPOINTITEM_H
#define TEXTPOINTITEM_H
#include "textitem.h"
2019-05-10 18:56:19 +02:00
class QFont;
class QImage;
class QColor;
class TextPointItem : public TextItem
2019-05-10 18:56:19 +02:00
{
public:
TextPointItem(const QPoint &point, const QString *text, const QFont *font,
2021-04-18 12:20:07 +02:00
const QImage *img, const QColor *color, const QColor *haloColor,
const QColor *bgColor = 0, int padding = 0, double rotate = NAN);
2019-05-10 18:56:19 +02:00
bool isValid() const {return !_rect.isEmpty();}
QRectF boundingRect() const {return _rect;}
QPainterPath shape() const {return _shape;}
2019-05-10 18:56:19 +02:00
void paint(QPainter *painter) const;
void setPos(const QPoint &point, int padding = 0);
2019-06-30 20:39:22 +02:00
2019-05-10 18:56:19 +02:00
private:
const QFont *_font;
const QImage *_img;
2021-04-18 12:20:07 +02:00
const QColor *_color, *_haloColor, *_bgColor;
double _rotate;
QRectF _rect, _textRect;
QPainterPath _shape;
2019-05-10 18:56:19 +02:00
};
#endif // TEXTPOINTITEM_H