Commit 6d192bd8 authored by Marco Bubke's avatar Marco Bubke

QmlDesigner: Don't reparent if the new parent property is the same

Change-Id: I5de80a9896c17e22e52b5cc1e209c728cfd5616f
Reviewed-by: default avatarTim Jenssen <tim.jenssen@digia.com>
parent 9ae8846d
......@@ -623,17 +623,19 @@ static bool isInLayoutable(NodeAbstractProperty &parentProperty)
static void reparentModelNodeToNodeProperty(NodeAbstractProperty &parentProperty, const ModelNode &modelNode)
{
if (isInLayoutable(parentProperty)) {
removePosition(modelNode);
parentProperty.reparentHere(modelNode);
} else {
if (QmlItemNode::isValidQmlItemNode(modelNode)) {
QPointF scenePosition = QmlItemNode(modelNode).instanceScenePosition();
if (parentProperty != modelNode.parentProperty()) {
if (isInLayoutable(parentProperty)) {
removePosition(modelNode);
parentProperty.reparentHere(modelNode);
if (!scenePosition.isNull())
setScenePosition(modelNode, scenePosition);
} else {
parentProperty.reparentHere(modelNode);
if (QmlItemNode::isValidQmlItemNode(modelNode)) {
QPointF scenePosition = QmlItemNode(modelNode).instanceScenePosition();
parentProperty.reparentHere(modelNode);
if (!scenePosition.isNull())
setScenePosition(modelNode, scenePosition);
} else {
parentProperty.reparentHere(modelNode);
}
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment