From 0505b08a5607d2f488ec69cf2bd4e8b83bd97ede Mon Sep 17 00:00:00 2001 From: Johannes Witt Date: Mon, 26 Jul 2021 16:31:31 +0200 Subject: Add `GraphEdit` drag notifications This commit adds two signals: * connection_drag_begun, which is emitted when a connection is started to be created by the user and * `connection_drag_ended`, which is emitted when no longer a connection is created. Additionally `force_connection_drag_end()` adds the possibility to end the connection dragging. If called from user code, no other connection request signals are invoked. This is useful to add `GraphNode`s via shortcuts while the user is dragging a connection to directly connect the newly added node. --- doc/classes/GraphEdit.xml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'doc/classes') diff --git a/doc/classes/GraphEdit.xml b/doc/classes/GraphEdit.xml index c432410d3b..be6d9e07c3 100644 --- a/doc/classes/GraphEdit.xml +++ b/doc/classes/GraphEdit.xml @@ -109,6 +109,14 @@ Removes the connection between the [code]from_port[/code] slot of the [code]from[/code] GraphNode and the [code]to_port[/code] slot of the [code]to[/code] GraphNode. If the connection does not exist, no connection is removed. + + + + Ends the creation of the current connection. In other words, if you are dragging a connection you can use this method to abort the process and remove the line that followed your cursor. + This is best used together with [signal connection_drag_begun] and [signal connection_drag_ended] to add custom behavior like node addition through shortcuts. + [b]Note:[/b] This method suppresses any other connection request signals apart from [signal connection_drag_ended]. + + @@ -241,6 +249,19 @@ Emitted at the beginning of a GraphNode movement. + + + + + + Emitted at the beginning of a connection drag. + + + + + Emitted at the end of a connection drag. + + -- cgit v1.2.3