1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-10-07 07:13:21 +02:00
GPXSee/src/map/textpointitem.h

39 lines
894 B
C
Raw Normal View History

2019-05-10 18:56:19 +02:00
#ifndef TEXTPOINTITEM_H
#define TEXTPOINTITEM_H
#include <QRect>
#include <QString>
#include <QVector>
#include "textitem.h"
2019-05-10 18:56:19 +02:00
class QPainter;
class QFont;
class QImage;
class QColor;
class TextPointItem : public TextItem
2019-05-10 18:56:19 +02:00
{
public:
2020-10-17 14:26:59 +02:00
TextPointItem() : TextItem(0), _font(0), _img(0) {}
2019-05-10 18:56:19 +02:00
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, bool padding = true);
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;
2021-04-10 15:27:40 +02:00
void setPos(const QPoint &point, bool padding = true);
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;
2019-05-10 18:56:19 +02:00
QRect _rect, _textRect;
QPainterPath _shape;
2019-05-10 18:56:19 +02:00
};
#endif // TEXTPOINTITEM_H