{{ message }}
BUGFIX: GraphicsView::setScene(nullptr)#495
Merged
paceholder merged 2 commits intopaceholder:masterfrom Nov 14, 2025
Merged
Conversation
lonnie-souder-ii
requested changes
Nov 12, 2025
Collaborator
lonnie-souder-ii
left a comment
There was a problem hiding this comment.
- For clarity/brevity, I think it would be preferable to move your logic to the start of the function and then early return. This way we don't wrap everything in multiple
if (scene)statements. e.g.
void GraphicsView::setScene(BasicGraphicsScene *scene)
{
QGraphicsView::setScene(scene);
if (!scene) {
// Clear whatever is necessary
return;
}
// Original function mostly untouched
...
}- What does this give us? Is this just more in line with the upstream
QGraphicsScene::setScene()behaviour? Does calling this withnullptrclear the scene, do nothing, or something else?
paceholder
reviewed
Nov 12, 2025
paceholder
reviewed
Nov 12, 2025
Owner
There was a problem hiding this comment.
Is there any valid configuration when scene != nodeScene?
Shouldn't we better assert this condition?
Contributor
Author
There was a problem hiding this comment.
Is this acceptable?
void GraphicsView::onDeleteSelectedObjects()
{
if (!nodeScene()) return;
nodeScene()->undoStack().push(new DeleteCommand(nodeScene()));
}
paceholder
reviewed
Nov 12, 2025
Contributor
Author
lsouder-ozone3d
approved these changes
Nov 13, 2025
Contributor
lsouder-ozone3d
left a comment
There was a problem hiding this comment.
Looks good to me now. 谢谢,太棒了!
Leaving this one for @paceholder to merge when he's ready.
lonnie-souder-ii
approved these changes
Nov 13, 2025
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
GraphicsView::setScene support nullptr
Testing
Breaking changes?
None.
Related issue
None.
Please fill out the sections above to help reviewers understand your changes.