+ if (children.at(i)->type() == GROUPWIDGET) {
+ QList<QGraphicsItem *> subchildren = children.at(i)->childItems();
+ for (int j = 0; j < subchildren.count(); j++) {
+ collidingItems.removeAll(subchildren.at(j));
+ }
+ }
+ collidingItems.removeAll(children.at(i));
+ }
+ offset = 0;
+
+ for (int i = 0; i < collidingItems.count(); i++) {
+ if (collidingItems.at(i)->type() == TRANSITIONWIDGET && snappedPos < m_selectionGroup->sceneBoundingRect().left()) {
+ AbstractClipItem *item = static_cast <AbstractClipItem *>(collidingItems.at(i));
+ // Moving backward, determine best pos
+ QPainterPath clipPath;
+ clipPath.addRect(item->sceneBoundingRect());
+ QPainterPath res = shape.intersected(clipPath);
+ offset = qMax(offset, (int)(res.boundingRect().width() + 0.5));
+ }
+ }
+
+ snappedPos += offset;
+ // make sure we have no collision
+ shape = m_selectionGroup->transitionGroupShape(QPointF(snappedPos - m_selectionGroup->sceneBoundingRect().left(), 0));
+ collidingItems = scene()->items(shape, Qt::IntersectsItemShape);
+ collidingItems.removeAll(m_selectionGroup);
+ for (int i = 0; i < children.count(); i++) {
+ if (children.at(i)->type() == GROUPWIDGET) {
+ QList<QGraphicsItem *> subchildren = children.at(i)->childItems();
+ for (int j = 0; j < subchildren.count(); j++) {
+ collidingItems.removeAll(subchildren.at(j));
+ }
+ }