From 6a484c615ae3f04873fe41a415277ef6c2c37573 Mon Sep 17 00:00:00 2001 From: jaseg Date: Thu, 17 Dec 2020 15:43:37 +0100 Subject: WIP --- tagscene.h | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'tagscene.h') diff --git a/tagscene.h b/tagscene.h index 18f9f54..bb83da4 100644 --- a/tagscene.h +++ b/tagscene.h @@ -3,6 +3,7 @@ #include "sqlitebackend.h" #include "tagitem.h" +#include "numberator.h" #include #include @@ -14,8 +15,8 @@ class TagScene : public QGraphicsScene Q_OBJECT public: - TagScene() {} - ~TagScene() { this->blockSignals(true); } + TagScene() : m_previewTag(new TagItem()) {} + ~TagScene() { this->blockSignals(true); delete m_previewTag; } const QGraphicsPixmapItem *backgroundPixmapItem() const { return pix_it; } public slots: @@ -23,6 +24,9 @@ public slots: void reloadScene(); void selectTag(const Tag &tag); + void setTool(ToolType tool); + void abortTool(); + void setProject(SQLiteSaveFile *proj); signals: @@ -31,6 +35,8 @@ signals: protected: void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) override; + void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override; + void mousePressEvent(QGraphicsSceneMouseEvent *event) override; private slots: void tagChanged(TagChange change, const Tag &tag); @@ -43,6 +49,12 @@ private: QGraphicsPixmapItem *pix_it = nullptr; QPixmap pix; QMap tags; + ToolType m_tool; + enum TagToolState { + TAG_TOOL_ANCHOR, + TAG_TOOL_LABEL + } m_tagToolState = TAG_TOOL_ANCHOR; + TagItem *m_previewTag; }; #endif // TAGSCENE_H -- cgit