summaryrefslogtreecommitdiff
path: root/tagitem.h
diff options
context:
space:
mode:
Diffstat (limited to 'tagitem.h')
-rw-r--r--tagitem.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/tagitem.h b/tagitem.h
new file mode 100644
index 0000000..a248243
--- /dev/null
+++ b/tagitem.h
@@ -0,0 +1,32 @@
+#ifndef TAGITEM_H
+#define TAGITEM_H
+
+#include "sqlitebackend.h"
+
+#include <QGraphicsPixmapItem>
+
+
+class TagItem : public QGraphicsSimpleTextItem
+{
+public:
+ TagItem(const Tag &tag);
+ TagItem() : valid(false) {};
+
+ enum { TagItemType = UserType + 1 };
+ int type() const override { return TagItemType; }
+
+ bool isValid() { return valid; }
+
+ void tagUpdated(const Tag &tag);
+
+ Tag tag() { return m_tag; }
+
+protected:
+ QVariant itemChange(QGraphicsItem::GraphicsItemChange change, const QVariant &value) override;
+
+private:
+ Tag m_tag;
+ bool valid;
+};
+
+#endif // TAGITEM_H