Skip to content

setNodeData no longer called when a node is moved #526

@JamesBloomScheff2

Description

@JamesBloomScheff2

Description with steps to reproduce

I'm not sure if this is a bug, or I just need information on how to deal with a behavior change in QtNodes.

I just updated to a newer version of QtNodes along with moving from Qt5.15 to some version of Qt6, and I’ve run into a problem when a node is moved.

When a user moves a node, I pick up the new position by overriding setNodeData and storing the new position. NodeGraphicsObject::mouseMoveEvent would call MoveNodeCommand::redo() which would call setNodeData.

With the new version of QtNodes, NodeGraphicsObject::mouseMoveEvent no longer calls MoveNodeCommand::redo() and setNodeData is never called for the new position of the node.

  1. Doesn’t that mean that the saved position of the node in _nodeGeometryData is now incorrect?
  2. What is the best way of picking up the new position? I have overridden QGraphicsScene::event so I could do a bunch of tests and figure out which node was moved, but that seems like a lot of work. I imagine that there is a better way.

Thanks

James Bloom-Scheff

Supporting files, videos and screenshots

N/A

Qt Version

6.7.3-02

Operating system

Windows 11, Linux

Additional context

My program is based off of DataFlowGraphModel

Checklist

  • I have verified that this issue has not been logged before, by searching the issue tracker for similar issues
  • I have attached all requested files and information to this report
  • I have attempted to identify the root problem as concisely as possible, and have used minimal reproducible examples where possible

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions