2019-06-07 20:33:08 +02:00
|
|
|
#ifndef TEXTITEM_H
|
|
|
|
#define TEXTITEM_H
|
|
|
|
|
|
|
|
#include <QList>
|
|
|
|
#include <QRectF>
|
|
|
|
#include <QPainterPath>
|
|
|
|
|
|
|
|
class QPainter;
|
|
|
|
|
|
|
|
class TextItem
|
|
|
|
{
|
|
|
|
public:
|
2020-10-17 14:26:59 +02:00
|
|
|
TextItem(const QString *text) : _text(text) {}
|
2019-06-07 20:33:08 +02:00
|
|
|
virtual ~TextItem() {}
|
|
|
|
|
|
|
|
virtual QPainterPath shape() const = 0;
|
|
|
|
virtual QRectF boundingRect() const = 0;
|
|
|
|
virtual void paint(QPainter *painter) const = 0;
|
|
|
|
|
2020-10-17 14:26:59 +02:00
|
|
|
const QString *text() const {return _text;}
|
2019-06-07 20:33:08 +02:00
|
|
|
bool collides(const QList<TextItem*> &list) const;
|
2020-10-17 14:26:59 +02:00
|
|
|
|
|
|
|
protected:
|
|
|
|
const QString *_text;
|
2019-06-07 20:33:08 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // TEXTITEM_H
|