summaryrefslogtreecommitdiff
path: root/tagitem.h
diff options
context:
space:
mode:
Diffstat (limited to 'tagitem.h')
-rw-r--r--tagitem.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/tagitem.h b/tagitem.h
index 3863d40..908f441 100644
--- a/tagitem.h
+++ b/tagitem.h
@@ -12,12 +12,13 @@ public:
TagItem(const Tag &tag);
TagItem() : valid(false) {};
- enum { TagItemType = UserType + 1 };
- int type() const override { return TagItemType; }
+ enum { Type = UserType + 1 };
+ int type() const override { return Type; }
bool isValid() { return valid; }
void tagUpdated(const Tag &tag);
Tag tag() { return m_tag; }
+
virtual QRectF boundingRect() const override;
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
virtual QPainterPath shape() const override;
@@ -25,9 +26,14 @@ public:
protected:
QVariant itemChange(QGraphicsItem::GraphicsItemChange change, const QVariant &value) override;
+ virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override;
+ virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override;
+
private:
Tag m_tag;
bool valid;
+ QMargins m_margins;
+ bool dragAboveThreshold = false;
};
#endif // TAGITEM_H