nodeeditor icon indicating copy to clipboard operation
nodeeditor copied to clipboard

Dynamic port node

Open signmotion opened this issue 6 years ago • 6 comments

Thanks for awesome node editor, Dmitry! I played with him a few evenings and delighted with the architect and opportunities for decor it.

I added the signals for add and remove ports. Maybe you want to add this to your repository. Video: https://youtu.be/KUt4qlTLrW0

There is a problem when removing connections. I didn't know how correct remove connections from the FlowScene.

signmotion avatar Jan 31 '19 12:01 signmotion

Hey, this looks awesome.

Let me stabilize continuous integration builds and then I come back to your PR.

Regards,

Dmitry

paceholder avatar Feb 06 '19 15:02 paceholder

Could you please rebase onto the latest master and squash your commits?

paceholder avatar Feb 06 '19 21:02 paceholder

Did this, Dmitry. I seem to make a mistake with the rebase and squash branches. I do not how to fix it in this PR, sorry.

signmotion avatar Feb 07 '19 08:02 signmotion

@paceholder , if @signmotion will refuse to fulfill your requirements, please find my pull request with his work squashed and rebased.

aol-nnov avatar Feb 17 '19 19:02 aol-nnov

Hi, great feature, I've been using it in my fork. I noticed that my application would crash when loading scenes with dynamic port nodes with an out-of-range exception on the input/output connection vectors in the nodestates.

I created a new PR with fix https://github.com/paceholder/nodeeditor/pull/268 for anyone who might need this feature (since the original PR has not been accepted yet)

willys0 avatar Aug 12 '20 12:08 willys0

I played a bit with this branch and the @willys0 fix. The main point is Node::onPortAdded() and Node::onPortRemoved() just resize the underlying connection vector, so they kinda works when the last port is added or removed, but if I have 5 ports connected and remove connection at index 2 the layout breaks. So I guess at least signal portRemoved() e and onPortRemoved should have the index of the connection port removed to correctly remove the right port.

Daguerreo avatar Aug 13 '20 21:08 Daguerreo

Thanks for your contribution. I've implemented the feature in the latest master. The current code correctly handles the changed connection order is using somehow similar approach to data modifications as in Qt's QAbstractItemModel class used for trees and tables.

paceholder avatar Dec 06 '22 20:12 paceholder