paceholder / nodeeditor

Qt Node Editor. Dataflow programming framework
BSD 3-Clause "New" or "Revised" License
2.94k stars 796 forks source link

Impossible to pull connection from a connected in port #327

Closed AokiYuune closed 1 year ago

AokiYuune commented 1 year ago

Hello, paceholder! Thanks for your great library. In most node editor, when user pull connection from a connected in port, they disconnect the previous one and connect the new one. May support it?

paceholder commented 1 year ago

Hi @AokiYuune ,

I think the desired behavior depends on the port's policy. For "many" a mouse-pull from the port initiates a new connection. For "one" it detaches the connection.

paceholder commented 1 year ago

See

enum NodeDataModel::ConnectionPolicy

AokiYuune commented 1 year ago

I see. Thanks for your reply.

AokiYuune commented 1 year ago

https://user-images.githubusercontent.com/43339352/203033306-fb0de051-3be6-4ac4-9cf6-1c37a96da5b6.mp4

Hi @paceholder , I tried to change NodeDataModel::ConnectionPolicy, but still cannot get the expected result. Pls see the video, I want to pull new connection to replace the old one. I can work for a PR to match this desire, if you wish to.