Skip to content
Snippets Groups Projects
Commit f0a6a0ab authored by Marco Bubke's avatar Marco Bubke Committed by Kai Koehne
Browse files

Do reparenting only with the control modifier hold

The isContainer flag is now ignored.

Reviewed-by: kkoehne
parent a41876cd
No related branches found
No related tags found
No related merge requests found
...@@ -148,7 +148,7 @@ FormEditorItem* ItemCreatorTool::calculateContainer(const QPointF &point) ...@@ -148,7 +148,7 @@ FormEditorItem* ItemCreatorTool::calculateContainer(const QPointF &point)
QList<QGraphicsItem *> list = scene()->items(point); QList<QGraphicsItem *> list = scene()->items(point);
foreach (QGraphicsItem *item, list) { foreach (QGraphicsItem *item, list) {
FormEditorItem *formEditorItem = FormEditorItem::fromQGraphicsItem(item); FormEditorItem *formEditorItem = FormEditorItem::fromQGraphicsItem(item);
if (formEditorItem && formEditorItem->isContainer()) if (formEditorItem)
return formEditorItem; return formEditorItem;
} }
return 0; return 0;
......
...@@ -90,12 +90,12 @@ void MoveTool::mouseMoveEvent(const QList<QGraphicsItem*> &itemList, ...@@ -90,12 +90,12 @@ void MoveTool::mouseMoveEvent(const QList<QGraphicsItem*> &itemList,
m_resizeIndicator.hide(); m_resizeIndicator.hide();
FormEditorItem *containerItem = containerFormEditorItem(itemList, m_movingItems); FormEditorItem *containerItem = containerFormEditorItem(itemList, m_movingItems);
if (containerItem && if (containerItem
containerItem != m_movingItems.first()->parentItem() && && view()->currentState().isBaseState()) {
view()->currentState().isBaseState() && if (containerItem != m_movingItems.first()->parentItem()
!event->modifiers().testFlag(Qt::ShiftModifier)) { && event->modifiers().testFlag(Qt::ShiftModifier)) {
m_moveManipulator.reparentTo(containerItem);
m_moveManipulator.reparentTo(containerItem); }
} }
bool shouldSnapping = view()->widget()->snappingAction()->isChecked(); bool shouldSnapping = view()->widget()->snappingAction()->isChecked();
...@@ -313,9 +313,7 @@ FormEditorItem* MoveTool::containerFormEditorItem(const QList<QGraphicsItem*> &i ...@@ -313,9 +313,7 @@ FormEditorItem* MoveTool::containerFormEditorItem(const QList<QGraphicsItem*> &i
if (formEditorItem if (formEditorItem
&& !selectedItemList.contains(formEditorItem) && !selectedItemList.contains(formEditorItem)
&& isNotAncestorOfItemInList(formEditorItem, selectedItemList)) && isNotAncestorOfItemInList(formEditorItem, selectedItemList))
if (formEditorItem->isContainer()) {
return formEditorItem; return formEditorItem;
}
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment