summaryrefslogtreecommitdiff
path: root/tagscene.h
diff options
context:
space:
mode:
authorjaseg <git-bigdata-wsl-arch@jaseg.de>2020-12-17 15:43:37 +0100
committerjaseg <git-bigdata-wsl-arch@jaseg.de>2020-12-17 15:43:37 +0100
commit6a484c615ae3f04873fe41a415277ef6c2c37573 (patch)
treeb2f429eb1baf703463821624691921e1426b7361 /tagscene.h
parentc6713d0876ce2d99f912151c9884477606909681 (diff)
downloadnumberator-master.tar.gz
numberator-master.tar.bz2
numberator-master.zip
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