Skip to content

Node groups: repaint loop, stale drag state, paste position #537

Open

Description

@paceholder

Description with steps to reproduce

Smaller problems in the group feature and in the paste path.

  1. Constant repaint. GroupGraphicsObject::paint() calls prepareGeometryChange(), setRect() and positionLockedIcon(). Each call schedules another paint. An idle view with one group repaints about 90 times in 300 ms. Without a group it is 0. Compute the rectangle when positions, sizes or members change. paint() should only draw.
  2. Stale drag state. _draggingIntoGroup and _possibleGroup are reset only while the node still touches the group. Drag a node onto a group, move it far away in one step, release: it joins the group. _possibleGroup is a raw pointer and can dangle.
  3. Paste position. loadItems(..., usePastePos=true) offsets a group by ggoRef.pos(), which is always (0,0). Plain nodes use moveBy(), which skips the model. The library does not call this path, but it is public.
  4. Dead code. GroupGraphicsObject::setPosition has no callers. It also moves the nodes by position, not to it. I will remove it in the major version (see Move node groups into the model (next major version) #539). PasteCommand::_mouseScenePos is a reference to a local.
  5. Export. GroupGraphicsObject is not NODE_EDITOR_PUBLIC. On a Windows shared build, code that calls lock() or locked() may not link. I did not check this.

Items 1 and 2 may go away with the model-driven groups redesign. Items 3 to 5 are independent.

Supporting files, videos and screenshots

No screenshots. I found it with tests that send simulated mouse events and with code reading.

Qt Version

Qt 6.12.0

Operating system

macOS 26.6

Additional context

Found while checking the node group commit 0d28130 (#514). Points 1 to 4 were seen with tests. Point 5 (export) is a guess. I have no Windows build.

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions