diff options
3 files changed, 10 insertions, 4 deletions
diff --git a/src/plugins/qmldesigner/components/formeditor/movemanipulator.cpp b/src/plugins/qmldesigner/components/formeditor/movemanipulator.cpp index ecca77a73d..d55f85090f 100644 --- a/src/plugins/qmldesigner/components/formeditor/movemanipulator.cpp +++ b/src/plugins/qmldesigner/components/formeditor/movemanipulator.cpp @@ -332,7 +332,7 @@ void MoveManipulator::clear() m_beginVerticalCenterHash.clear(); } -void MoveManipulator::reparentTo(FormEditorItem *newParent) +void MoveManipulator::reparentTo(FormEditorItem *newParent, ReparentFlag flag) { deleteSnapLines(); @@ -348,7 +348,8 @@ void MoveManipulator::reparentTo(FormEditorItem *newParent) && newParent->qmlItemNode().modelNode().hasParentProperty()) { ModelNode grandParent = newParent->qmlItemNode().modelNode().parentProperty().parentModelNode(); if (grandParent.metaInfo().isLayoutable() - && !NodeHints::fromModelNode(grandParent).isStackedContainer()) + && !NodeHints::fromModelNode(grandParent).isStackedContainer() + && flag == DoNotEnforceReparent) newParent = m_view.data()->scene()->itemForQmlItemNode(QmlItemNode(grandParent)); } diff --git a/src/plugins/qmldesigner/components/formeditor/movemanipulator.h b/src/plugins/qmldesigner/components/formeditor/movemanipulator.h index 27b2e465f0..b64b31a97e 100644 --- a/src/plugins/qmldesigner/components/formeditor/movemanipulator.h +++ b/src/plugins/qmldesigner/components/formeditor/movemanipulator.h @@ -48,6 +48,11 @@ public: UseBaseState }; + enum ReparentFlag { + DoNotEnforceReparent, + EnforceReparent + }; + MoveManipulator(LayerItem *layerItem, FormEditorView *view); ~MoveManipulator(); void setItems(const QList<FormEditorItem*> &itemList); @@ -57,7 +62,7 @@ public: void begin(const QPointF& beginPoint); void update(const QPointF& updatePoint, Snapper::Snapping useSnapping, State stateToBeManipulated = UseCurrentState); - void reparentTo(FormEditorItem *newParent); + void reparentTo(FormEditorItem *newParent, ReparentFlag flag = DoNotEnforceReparent); void end(); void end(Snapper::Snapping useSnapping); diff --git a/src/plugins/qmldesigner/components/formeditor/movetool.cpp b/src/plugins/qmldesigner/components/formeditor/movetool.cpp index d6eaee3b2e..b779216d61 100644 --- a/src/plugins/qmldesigner/components/formeditor/movetool.cpp +++ b/src/plugins/qmldesigner/components/formeditor/movetool.cpp @@ -113,7 +113,7 @@ void MoveTool::mouseMoveEvent(const QList<QGraphicsItem*> &itemList, if (m_movingItems.count() > 1 || (movingItem->qmlItemNode().canBereparentedTo(containerItem->qmlItemNode()))) - m_moveManipulator.reparentTo(containerItem); + m_moveManipulator.reparentTo(containerItem, MoveManipulator::EnforceReparent); } } |