2019-05-10 18:56:19 +02:00
|
|
|
#ifndef TEXTPOINTITEM_H
|
|
|
|
#define TEXTPOINTITEM_H
|
|
|
|
|
|
|
|
#include <QRect>
|
|
|
|
#include <QString>
|
|
|
|
#include <QVector>
|
2019-06-07 20:33:08 +02:00
|
|
|
#include "textitem.h"
|
2019-05-10 18:56:19 +02:00
|
|
|
|
|
|
|
class QPainter;
|
|
|
|
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() : _text(0), _font(0), _img(0) {}
|
|
|
|
TextPointItem(const QPoint &point, const QString *text, const QFont *font,
|
2019-06-30 20:39:22 +02:00
|
|
|
const QImage *img, const QColor *color, const QColor *bgColor = 0);
|
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;
|
|
|
|
|
2019-06-30 20:39:22 +02:00
|
|
|
void setPos(const QPoint &point);
|
|
|
|
|
2019-05-10 18:56:19 +02:00
|
|
|
private:
|
|
|
|
const QString *_text;
|
|
|
|
const QFont *_font;
|
|
|
|
const QImage *_img;
|
2019-06-30 20:39:22 +02:00
|
|
|
const QColor *_color, *_bgColor;
|
2019-05-10 18:56:19 +02:00
|
|
|
QRect _rect, _textRect;
|
2019-06-07 20:33:08 +02:00
|
|
|
QPainterPath _shape;
|
2019-05-10 18:56:19 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // TEXTPOINTITEM_H
|