From d089be1c20e2b2c464350217a7ff26e6e748a7c3 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Mardelle Date: Thu, 15 Nov 2012 21:59:03 +0100 Subject: [PATCH] Fix broken group move when dragging an empty group zone --- src/abstractgroupitem.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/abstractgroupitem.cpp b/src/abstractgroupitem.cpp index 9442aa2b..8e482f4b 100644 --- a/src/abstractgroupitem.cpp +++ b/src/abstractgroupitem.cpp @@ -387,7 +387,17 @@ void AbstractGroupItem::mousePressEvent(QGraphicsSceneMouseEvent * event) if (event->modifiers() & Qt::ShiftModifier) { // User want to do a rectangle selection, so ignore the event to pass it to the view event->ignore(); - } else QGraphicsItem::mousePressEvent(event); + } else { + QList list = scene()->items(event->scenePos()); + // only allow group move if we click over an item in the group + foreach(const QGraphicsItem *item, list) { + if (item->type() == TRANSITIONWIDGET || item->type() == AVWIDGET) { + QGraphicsItem::mousePressEvent(event); + return; + } + } + event->ignore(); + } } void AbstractGroupItem::resizeStart(int diff) -- 2.39.2