klauer / qtpynodeeditor

Python Qt NodeEditor (qtpy, PyQt5, PySide)
https://klauer.github.io/qtpynodeeditor/
Other
186 stars 53 forks source link

NodeDataModel class input_connection_created called twice #27

Closed klauer closed 4 years ago

klauer commented 4 years ago

Originally posted by @thorphil in https://github.com/klauer/qtpynodeeditor/issues/12#issuecomment-572709565:

I came across an issue where my NodeDataModel class input_connection_created was being called twice after a successful connection. Tracing this back, it seems to be caused by a the _FlowSceneModel constructor being called twice when the FlowScene is instantiated, thus registering two signal-slot connections. To fix, I changed the order of parents in FlowScene from (QGraphicsScene,_FlowSceneModel) to (_FlowSceneModel,QGraphicsScene). I am not entirely sure why this fixed the issue.

klauer commented 4 years ago

@thorphil I've removed your comment in the other issue so that it can be discussed/resolved here.