GraphicsTextItem.h 573 B

123456789101112131415161718192021222324
  1. #pragma once
  2. #include "preheader.h"
  3. class GraphicsTextItem : public QGraphicsTextItem
  4. {
  5. Q_OBJECT
  6. public:
  7. enum { Type = UserType + 3 };
  8. GraphicsTextItem(QGraphicsItem *parent = 0);
  9. int type() const override { return Type; }
  10. signals:
  11. void lostFocus(GraphicsTextItem *item);
  12. void selectedChange(QGraphicsItem *item);
  13. protected:
  14. QVariant itemChange(GraphicsItemChange change, const QVariant &value) override;
  15. void focusOutEvent(QFocusEvent *event) override;
  16. void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) override;
  17. };