Reconnect copied/pasted nodes together but not to the graph

If several nodes are described in the clipboard and are supposed to
be connected with each other, reconnect them together, but do not
attempt to reconnect them to the graph they were copied from, even if
it is the current graph.
This commit is contained in:
Candice Bentéjac 2022-09-06 11:13:29 +02:00
parent a33f79e4d7
commit d06acf6722
4 changed files with 161 additions and 61 deletions

View file

@ -91,7 +91,12 @@ Item {
{
root.pastePosition = mapToItem(draggable, mouseArea.mouseX, mouseArea.mouseY)
var copiedContent = Clipboard.getText()
uigraph.pasteNodes(copiedContent, root.pastePosition)
var nodes = uigraph.pasteNodes(copiedContent, root.pastePosition)
if (nodes.length > 0) {
uigraph.clearNodeSelection()
uigraph.selectedNode = nodes[0]
uigraph.selectNodes(nodes)
}
}
Keys.onPressed: {