Commit 53e687ec authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

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: default avatarMarco Bubke <marco.bubke@digia.com>
parent a8a9786b
......@@ -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();
......
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