★ wanayoo — archive 1999 https://github.com/paceholder/nodeeditor/issues/188Nouvelle recherche | Portail wanayoo
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion: Steal NodeDataModel when removing a Node from a FlowScene #188

Open
LaurentNovac opened this issue Jun 19, 2018 · 0 comments
Open

Comments

@LaurentNovac
Copy link

@LaurentNovac LaurentNovac commented Jun 19, 2018 •

Hi ! and congrats for this useful library i've been using for a few days !

Here is my suggestion / question
Maybe i'm missing something here:

QtNodes::Node is the owner of QtNodes::NodeDataModel which is perfect

  Node&createNode(std::unique_ptr<NodeDataModel> && dataModel);
  Node(std::unique_ptr<NodeDataModel> && dataModel);

My use case is that i'm implementing Macro patches such as you can see in Quartz composer. So i need to "move" nodes between scenes.

I would then like to steal the model from a Node in a safe way, when i know it will no longer be used.
My suggestion is that:

void FlowScene::removeNode(Node& node);

become

std::unique_ptr<NodeDataModel> FlowScene::removeNode(Node& node);

which means that before completely destroying the Node it would move it's model, which is safe as the Node will be destroyed.

I hope this make sense and if not could you please point me to a better solution ? Otherwise i would gladly do a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.