diff options
author | jaseg <git-bigdata-wsl-arch@jaseg.de> | 2020-12-17 15:43:37 +0100 |
---|---|---|
committer | jaseg <git-bigdata-wsl-arch@jaseg.de> | 2020-12-17 15:43:37 +0100 |
commit | 6a484c615ae3f04873fe41a415277ef6c2c37573 (patch) | |
tree | b2f429eb1baf703463821624691921e1426b7361 /tagscene.h | |
parent | c6713d0876ce2d99f912151c9884477606909681 (diff) | |
download | numberator-master.tar.gz numberator-master.tar.bz2 numberator-master.zip |
Diffstat (limited to 'tagscene.h')
-rw-r--r-- | tagscene.h | 16 |
1 files changed, 14 insertions, 2 deletions
@@ -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 |