2019-05-10 18:56:19 +02:00
|
|
|
#ifndef TEXTPOINTITEM_H
|
|
|
|
#define TEXTPOINTITEM_H
|
|
|
|
|
2023-12-26 14:14:08 +01:00
|
|
|
#include <cmath>
|
2019-06-07 20:33:08 +02:00
|
|
|
#include "textitem.h"
|
2019-05-10 18:56:19 +02:00
|
|
|
|
|
|
|
class QFont;
|
|
|
|
class QImage;
|
|
|
|
class QColor;
|
|
|
|
|
2019-06-07 20:33:08 +02:00
|
|
|
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,
|
2023-05-26 21:28:44 +02:00
|
|
|
const QColor *bgColor = 0, int padding = 0, double rotate = NAN);
|
2019-05-10 18:56:19 +02:00
|
|
|
|
2019-06-07 20:33:08 +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;
|
|
|
|
|
2022-03-26 17:20:16 +01:00
|
|
|
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;
|
2023-05-26 21:28:44 +02:00
|
|
|
double _rotate;
|
2022-02-15 00:01:48 +01:00
|
|
|
QRectF _rect, _textRect;
|
2019-06-07 20:33:08 +02:00
|
|
|
QPainterPath _shape;
|
2019-05-10 18:56:19 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // TEXTPOINTITEM_H
|