Skip to content

Adds validation state feedback to nodes #475

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

tatatupi
Copy link
Contributor

@tatatupi tatatupi commented Jun 22, 2025

The idea is to have a NodeValidationState member object in the NodeDelegateModel class, that defaults to a valid and empty state message. The API allows for updates to be made accordingly, and the UI will respond automatically.

UI will show a node red (error) or yellow (warning). A tooltip is added with the state message. And a small icon for information is displayed as a badge, to help the user access the tooltip. I added a screenshot of the calculator example to help discussions. in the example, the tooltip for the Warning state is displayed.

Key Changes

  • Introduces NodeValidationState struct class.
  • Getter and setter in NodeDelegateModel for validation.
  • DataFlowGraphModel handles NodeRole::ValidationState updates.
  • Painting logic reflects invalid states in DefaultNodePainter.
  • Tooltip shows validation message in NodeGraphicsObject.
  • Calculator example demonstrates usage.

image

Solves #226
Solves #75

P.S.: some changes happened automatically when saving files, due to autoformatting using nodeeditor clang format style.

@tatatupi
Copy link
Contributor Author

I also changed the linux-gcc qt version to 6, so that QtGui/QUndoCommand include could work

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