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 /tagitem.cpp | |
parent | c6713d0876ce2d99f912151c9884477606909681 (diff) | |
download | numberator-6a484c615ae3f04873fe41a415277ef6c2c37573.tar.gz numberator-6a484c615ae3f04873fe41a415277ef6c2c37573.tar.bz2 numberator-6a484c615ae3f04873fe41a415277ef6c2c37573.zip |
Diffstat (limited to 'tagitem.cpp')
-rw-r--r-- | tagitem.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/tagitem.cpp b/tagitem.cpp index 01b26fb..8c17ba6 100644 --- a/tagitem.cpp +++ b/tagitem.cpp @@ -11,7 +11,6 @@ TagItem::TagItem(const Tag &tag) , m_margins(2, 2, 2, 2)
{
setFlags(QGraphicsItem::ItemIsSelectable
- | QGraphicsItem::ItemIsMovable
| QGraphicsItem::ItemIsFocusable
| QGraphicsItem::ItemIgnoresTransformations
| QGraphicsItem::ItemSendsGeometryChanges);
@@ -97,6 +96,9 @@ QVariant TagItem::itemChange(QGraphicsItem::GraphicsItemChange change, const QVa *
*/
/* FIXME */
+ } else if (change == ItemSelectedChange) {
+ if (!value.toBool())
+ setFlag(QGraphicsItem::ItemIsMovable, false);
}
return QGraphicsItem::itemChange(change, value);
}
@@ -123,5 +125,10 @@ void TagItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) {
Q_UNUSED(event);
dragAboveThreshold = false;
+ if (isSelected())
+ setFlag(QGraphicsItem::ItemIsMovable, true);
+ else
+ setFlag(QGraphicsItem::ItemIsMovable, false);
+
QGraphicsItem::mouseReleaseEvent(event);
}
|