Skip to content

Add a guide to change notifications and describe the Size role - #576

Merged
paceholder merged 1 commit into
masterfrom
docs-update-flow
Dec 2, 2026
Merged

paceholder merged 1 commit into
masterfrom
docs-update-flow

Conversation

@paceholder

@paceholder paceholder commented Dec 2, 2026 •

Copy link
Copy Markdown
Owner

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation/refactoring

Description

A new guide page, Change Notifications, explains how a change travels from the model to the scene: the rule (the model is the single source of truth), the signals that the scene listens to, who notifies whom, the main cases (node drag, node creation and load, connection creation and data, undo and redo, the size of an embedded widget), what a custom model, delegate or geometry must emit, and the pitfalls. It has five Mermaid diagrams, and each has a plain-text fallback in a comment in the source. The page is based on a trace of the update paths with call counts, and it describes master after #575.

NodeRole::Size now has one description in all places: the comment in Definitions.hpp, the roles table in graph-models.rst, the comment of AbstractGraphModel::setNodeData, and the Resizable section of the advanced guide. It is the layout size that the geometry computes, and the model only stores it and returns it. It is not an input: a value set from code does not resize the node, and the next nodeUpdated replaces it. The handle of a resizable node resizes the embedded widget, and the node follows.

The Size example in the advanced guide emitted nodeUpdated when Size is set. The scene sets Size while it handles nodeUpdated, so this made an endless recursion. The example does not emit it any more, and the text says why.

Nothing here changes behavior. The text describes what 3.x does today. The only code change is two comments in headers.

The diagrams need the Sphinx extension sphinxcontrib-mermaid. It is added to docs/conf.py and docs/requirements.txt. The extension loads mermaid.js from a CDN in the browser, so Read the Docs needs no Node.js.

Testing

  • Qt version tested: not applicable (documentation).
  • Built the docs with Sphinx 7.4.7, breathe 5.1.0 and sphinxcontrib-mermaid 1.2.3 in a fresh virtualenv. The build succeeds and the page has 5 diagrams. No warning mentions the new page or advanced.rst. The other warnings (41 from a missing Doxygen XML in my checkout, 2 that master also has) are not from this change.
  • Not tested: the Read the Docs build, and the rendering of the diagrams in a browser. I did not open the page with internet access.

Breaking changes?

No.

Related issue

None.

The guide explains who notifies whom when the graph changes, with Mermaid
diagrams. It needs sphinxcontrib-mermaid.

NodeRole::Size has one description in the header, the roles table, the
setNodeData comment and the advanced guide: it is the layout size that the
geometry computes, and the model only stores it. It is not an input. The old
advice to emit nodeUpdated when Size is set made an endless recursion and is
removed.
@paceholder paceholder changed the title Add a guide to change notifications and fix the Size advice Add a guide to change notifications and describe the Size role Dec 2, 2026
@paceholder
paceholder merged commit c534f44 into master Dec 2, 2026
5 checks passed
@paceholder
paceholder deleted the docs-update-flow branch December 2, 2026 20:10
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

Successfully merging this pull request may close these issues.

1 participant