2017-05-05 23:59:39 +02:00
|
|
|
#ifndef TEXTITEM_HPP
|
|
|
|
#define TEXTITEM_HPP
|
|
|
|
|
|
|
|
#include "drawitem.hpp"
|
2017-07-29 17:22:17 +02:00
|
|
|
#include <QApplication>
|
2017-05-05 23:59:39 +02:00
|
|
|
#include <QGraphicsSimpleTextItem>
|
|
|
|
|
|
|
|
class TextItem : public DrawItem {
|
2017-07-29 17:22:17 +02:00
|
|
|
Q_DECLARE_TR_FUNCTIONS(TextItem)
|
2017-06-14 23:34:58 +02:00
|
|
|
public:
|
2017-05-09 17:26:00 +02:00
|
|
|
QString name() override;
|
2017-06-29 19:09:39 +02:00
|
|
|
bool init(CropScene *s) override;
|
2017-07-08 21:40:09 +02:00
|
|
|
void mouseDragEvent(QGraphicsSceneMouseEvent *, CropScene *scene) override;
|
2017-05-09 17:26:00 +02:00
|
|
|
void mouseDragEndEvent(QGraphicsSceneMouseEvent *, CropScene *) override;
|
2017-05-05 23:59:39 +02:00
|
|
|
|
2017-06-14 23:34:58 +02:00
|
|
|
private:
|
2017-05-09 17:26:00 +02:00
|
|
|
QGraphicsSimpleTextItem *textItem = nullptr;
|
|
|
|
QString text;
|
2017-05-05 23:59:39 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // TEXTITEM_HPP
|