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

[v3alpha] An issue with the working of draft connection #318

Closed
velorom opened this issue May 26, 2022 · 3 comments
Closed

[v3alpha] An issue with the working of draft connection #318

velorom opened this issue May 26, 2022 · 3 comments

Comments

@velorom
Copy link

velorom commented May 26, 2022

In ConnectionGraphicsObject on mouseMove event you transfer self to hovered node for reaction:
ngo->reactToConnection(this);
This connection is using in NodePainter::drawConnectionPoints for painting ports. And you reset this pointer at the end of this method.
But sometimes mouseRelease event of ConnectionGraphicsObject and corresponding destroying of draft connection happens before NodePainter::drawConnectionPoints call.
So sometimes NodePainter accesses the destroyed pointer.

I think you need to let the scene set reaction connection to nodes and tracks for it destruction.

@paceholder
Copy link
Owner

Thanks for pointing this out, I'll have a look in the nearest days.

@velorom
Copy link
Author

velorom commented Jul 11, 2022

There is another small fix. Maybe it is a typo, but in NodeGraphicsObject::itemChange you must change the ItemPositionChange value to ItemPositionHasChanged, because you call moveConnections(), where you update connections positions. But at this moment node position is not changed yet. This leads to the effect of connections lagging behind node ports.

@paceholder
Copy link
Owner

  1. I used QPointer, it is cleared automatically when the object inside is destroyed.
  2. To me the two options were not clearly distinguishable. ItemPositionChange, ItemPositionHasChanged. Now I see the difference.

Thanks for your valuable and inspective remarks!

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

No branches or pull requests

2 participants