diff --git a/src/plugins/qmldesigner/components/integration/designdocument.cpp b/src/plugins/qmldesigner/components/integration/designdocument.cpp index 47694f844da..c17ed3b6a26 100644 --- a/src/plugins/qmldesigner/components/integration/designdocument.cpp +++ b/src/plugins/qmldesigner/components/integration/designdocument.cpp @@ -560,7 +560,8 @@ void DesignDocument::paste() targetNode = view.firstSelectedModelNode(); // in case we copy and paste a selection we paste in the parent item - if ((view.selectedModelNodes().count() == selectedNodes.count()) && targetNode.isValid() && targetNode.hasParentProperty()) { + if ((view.selectedModelNodes().count() == selectedNodes.count()) + && targetNode.hasParentProperty()) { targetNode = targetNode.parentProperty().parentModelNode(); } else if (view.selectedModelNodes().isEmpty()) { // if selection is empty and copied nodes are all 3D nodes, paste them under the active scene