28 lines
603 B
C
Raw Normal View History

2018-10-29 00:11:23 +01:00
#ifndef TEXT_H
#define TEXT_H
#include "textitem.h"
2018-10-29 00:11:23 +01:00
class Text
2018-10-29 00:11:23 +01:00
{
public:
2018-11-17 21:54:51 +01:00
Text(const QSize &size) : _sceneRect(QRectF(QPointF(0, 0), size)) {}
~Text();
2018-11-13 01:01:36 +01:00
void render(QPainter *painter) const;
2018-10-29 00:11:23 +01:00
2018-11-13 18:24:51 +01:00
void addLabel(const QString &text, const QPointF &pos,
const QPainter &painter, qreal maxTextWidth);
2018-10-29 00:11:23 +01:00
void addLabel(const QString &text, const QPainterPath &path,
2018-11-13 18:24:51 +01:00
const QPainter &painter, qreal maxAngle);
private:
void addItem(TextItem *item) {_items.append(item);}
QList<TextItem *> collidingItems(const TextItem *item) const;
QRectF _sceneRect;
QList<TextItem *> _items;
2018-10-29 00:11:23 +01:00
};
#endif // TEXT_H