nodeeditor
nodeeditor copied to clipboard
FlowScene::connectionCreated emits while Input Port is nullptr.
When I listen to this [signal]
(https://github.com/paceholder/nodeeditor/blob/87f0d386bfca24958e4ee2bd52763a13eb04ce10/include/
nodes/internal/FlowScene.hpp#L106)
void connectionCreated(Connection &c);
, it gets emitted when clicking visually on an output port.
` void NodeGraphicsObject:: mousePressEvent(QGraphicsSceneMouseEvent * event) { ...
auto connection = _scene.createConnection(portToCheck, _node, portIndex); ...
} `
At this point the input port is still not selected. The signal should be emit, after connections output port and input port is selected and connection was created.
Adding this to ConnectionGraphicsObject:: mouseReleaseEvent(QGraphicsSceneMouseEvent* event) works for me: `if (node && interaction.tryConnect()) { node->resetReactionToConnection(); _scene.connectionCreated(_connection);
}` But I'm not sure about side effects.
Yes, it does this. The connection object is technically created, so it emits the signal even though it isn't between two nodes. #175 actually fixes this (or it would be a bug in my implementation)