- if (force || selection.count() > 1) {
- bool snap = KdenliveSettings::snaptopoints();
- KdenliveSettings::setSnaptopoints(false);
- if (createNewGroup) {
- AbstractGroupItem *newGroup = m_document->clipManager()->createGroup();
- newGroup->setPos(rectUnion.left(), rectUnion.top() - 1);
- QPointF diff = newGroup->pos();
- newGroup->translate(-diff.x(), -diff.y());
- //newGroup->translate((int) -rectUnion.left(), (int) -rectUnion.top() + 1);
-
- scene()->addItem(newGroup);
- // Check if we are trying to include a group in a group
- foreach (QGraphicsItemGroup *value, groupsList) {
- QList<QGraphicsItem *> children = value->childItems();
- for (int i = 0; i < children.count(); i++) {
- if (children.at(i)->type() == AVWIDGET || children.at(i)->type() == TRANSITIONWIDGET)
- itemsList.insert(children.at(i));
- }
- AbstractGroupItem *grp = static_cast<AbstractGroupItem *>(value);
- m_document->clipManager()->removeGroup(grp);
- scene()->destroyItemGroup(grp);
+ bool snap = KdenliveSettings::snaptopoints();
+ KdenliveSettings::setSnaptopoints(false);
+ if (createNewGroup) {
+ AbstractGroupItem *newGroup = m_document->clipManager()->createGroup();
+ newGroup->setPos(rectUnion.left(), rectUnion.top() - 1);
+ QPointF diff = newGroup->pos();
+ newGroup->translate(-diff.x(), -diff.y());
+ //newGroup->translate((int) -rectUnion.left(), (int) -rectUnion.top() + 1);
+
+ scene()->addItem(newGroup);
+ // Check if we are trying to include a group in a group
+ foreach (QGraphicsItemGroup *value, groupsList) {
+ QList<QGraphicsItem *> children = value->childItems();
+ for (int i = 0; i < children.count(); i++) {
+ if (children.at(i)->type() == AVWIDGET || children.at(i)->type() == TRANSITIONWIDGET)
+ itemsList.insert(children.at(i));