]> git.sesse.net Git - kdenlive/commitdiff
Fix broken group move when dragging an empty group zone
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Thu, 15 Nov 2012 20:59:03 +0000 (21:59 +0100)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Thu, 15 Nov 2012 20:59:03 +0000 (21:59 +0100)
src/abstractgroupitem.cpp

index 9442aa2ba08c227bfc31e582e675790832489e0e..8e482f4b2dcc43f88453dea9bc7390807bb355c8 100644 (file)
@@ -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 <QGraphicsItem *>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)