Repository navigation
Read the node id in the example models as an unsigned number - #570
Merged
Merged
Conversation
QJsonValue::toInt() returns 0 for ids above 2147483647. Use jsonValueToUInt32() as the library does.
paceholder
force-pushed
the
fix-simple-model-load-id
branch
from
November 29, 2026 20:22
b20ab85 to
e4089c2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type of change
Description
The example models read the node id with
QJsonValue::toInt(). It returns 0 for ids above 2147483647, so a saved id such as 3000000000 was loaded as node 0. The examples now usejsonValueToUInt32(), asDataFlowGraphModel::loadNode()does. This fixessimple_graph_model,custom_painter,vertical_layoutanddynamic_ports.An invalid id (missing or not a number) gives
InvalidNodeId. The examples do not check it, same asDataFlowGraphModel::loadNode().There is no new test. The examples are demos and the tests are for the library. The library path is covered by the test for ids above the int range in the scene load and group restore.
Testing
-DBUILD_EXAMPLES=ON. CI covers Qt5.Not tested: none of the four examples was run with a saved id above 2147483647.
Breaking changes?
No.
Related issue
None.