summaryrefslogtreecommitdiff
path: root/tagscene.h
diff options
context:
space:
mode:
Diffstat (limited to 'tagscene.h')
-rw-r--r--tagscene.h16
1 files changed, 14 insertions, 2 deletions
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 <QGraphicsPixmapItem>
#include <QGraphicsScene>
@@ -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<long long int, TagItem*> tags;
+ ToolType m_tool;
+ enum TagToolState {
+ TAG_TOOL_ANCHOR,
+ TAG_TOOL_LABEL
+ } m_tagToolState = TAG_TOOL_ANCHOR;
+ TagItem *m_previewTag;
};
#endif // TAGSCENE_H