WIP
This commit is contained in:
parent
c6713d0876
commit
6a484c615a
17 changed files with 175 additions and 7 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue