diff options
author | jaseg <git-bigdata-wsl-arch@jaseg.de> | 2020-08-09 17:12:14 +0200 |
---|---|---|
committer | jaseg <git-bigdata-wsl-arch@jaseg.de> | 2020-08-09 17:12:14 +0200 |
commit | 0afe9ca6bf53da111e445d2aea7cfc94e7e3c601 (patch) | |
tree | dba69d8eb86e81a1a56a388eafa85817762cf87f /tagitem.cpp | |
parent | 872bb95acf6fabd639da57cd41a4844d7e6dd0f0 (diff) | |
download | numberator-0afe9ca6bf53da111e445d2aea7cfc94e7e3c601.tar.gz numberator-0afe9ca6bf53da111e445d2aea7cfc94e7e3c601.tar.bz2 numberator-0afe9ca6bf53da111e445d2aea7cfc94e7e3c601.zip |
db backend: mostly feature-complete
Diffstat (limited to 'tagitem.cpp')
-rw-r--r-- | tagitem.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/tagitem.cpp b/tagitem.cpp new file mode 100644 index 0000000..d251428 --- /dev/null +++ b/tagitem.cpp @@ -0,0 +1,31 @@ +#include "tagitem.h"
+
+TagItem::TagItem(const Tag &tag)
+ : valid(true)
+{
+ setFlags(QGraphicsItem::ItemIsMovable
+ | QGraphicsItem::ItemIsSelectable
+ | QGraphicsItem::ItemIsFocusable);
+ /* TODO text_it.setFlags(QGraphicsItem::ItemIgnoresTransformations);
+ */
+ tagUpdated(tag);
+}
+
+void TagItem::tagUpdated(const Tag &tag)
+{
+ m_tag = tag;
+ setText(tag.name);
+ setPos(tag.anchor);
+}
+
+QVariant TagItem::itemChange(QGraphicsItem::GraphicsItemChange change, const QVariant &value)
+{
+ if (change == ItemPositionChange) {
+ /* https://gist.github.com/csukuangfj/c2a06416062bec9ed99eddd705c21275#file-qgraphicsscenetest-cpp-L90
+ *
+ */
+ /* FIXME */
+
+ }
+ return QGraphicsItem::itemChange(change, value);
+}
|