From 53e687eca637ccb2a7b7cc7f3bf39f2339a5427d Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Wed, 5 Mar 2014 15:57:40 +0100 Subject: [PATCH] QmlDesigner.CopyAndPaste: fix pasting into item without children Pasting "into" an item that did not have any children did not work. The method hasNodeListProperty() only return true if the item already has children. Change-Id: I00d20df1673758b22d056b8dd64a52c760aabf18 Reviewed-by: Marco Bubke --- .../qmldesigner/components/integration/designdocument.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/plugins/qmldesigner/components/integration/designdocument.cpp b/src/plugins/qmldesigner/components/integration/designdocument.cpp index d5a428e1a0b..973265738a7 100644 --- a/src/plugins/qmldesigner/components/integration/designdocument.cpp +++ b/src/plugins/qmldesigner/components/integration/designdocument.cpp @@ -552,8 +552,11 @@ void DesignDocument::paste() PropertyName defaultProperty(targetNode.metaInfo().defaultPropertyName()); scatterItem(pastedNode, targetNode); - if (targetNode.hasNodeListProperty(defaultProperty)) + if (targetNode.metaInfo().propertyIsListProperty(defaultProperty)) { targetNode.nodeListProperty(defaultProperty).reparentHere(pastedNode); + } else { + qWarning() << "Cannot reparent to" << targetNode; + } transaction.commit(); NodeMetaInfo::clearCache();