- QPainterPath shape = clipGroupShape(newPos - pos());
- QList<QGraphicsItem*> collindingItems = scene()->items(shape, Qt::IntersectsItemShape);
- for (int i = 0; i < children.count(); i++) {
- collindingItems.removeAll(children.at(i));
+ QList<QGraphicsItem*> collidingItems;
+ QPainterPath shape;
+ if (projectScene()->editMode() == NORMALEDIT) {
+ shape = clipGroupShape(newPos - pos());
+ collidingItems = scene()->items(shape, Qt::IntersectsItemShape);
+ collidingItems.removeAll(this);
+ 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));
+ }
+ }
+ collidingItems.removeAll(children.at(i));
+ }