PlugLayout : Prevent widgets being deleted when no longer accessories - #7125
Merged
johnhaddon merged 1 commit intoAug 27, 2026
Merged
Conversation
In situations where visible widgets are updated to no longer be shown under an _AccessoryRow, we see a `Internal C++ object (PySide6.QtWidgets.QWidget) already deleted` error and the Node Editor fails to show the node UI. This is a result of us trying to reuse a widget that was destroyed by Qt when its previous parent `_AccessoryRow` was removed from the updated layout. To prevent this, we now unparent all widgets from their old `_AccessoryRow`s before updating the layout. `_AccessoryRow`s are recreated as necessary on layout update, so the widgets needing one are parented to their new row, and the widgets transitioning from accessory to regular stay alive as they're no longer parented to a row pending deletion. Fixes GafferHQ#6938
Member
|
Thanks Murray - unparenting rather than adopting at the grandparent as in #6829 is definitely clearer. |
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.
This is an alternate take on the
layout:accessoryfix from #6829.In situations where visible widgets are updated to no longer be shown under an _AccessoryRow, we see a
Internal C++ object (PySide6.QtWidgets.QWidget) already deletederror and the Node Editor fails to show the node UI. This is a result of us trying to reuse a widget that was destroyed by Qt when its previous parent_AccessoryRowwas removed from the updated layout.To prevent this, we now unparent all widgets from their old _AccessoryRows before updating the layout. _AccessoryRows are recreated as necessary on layout update, so the widgets needing one are parented to their new row, and the widgets transitioning from accessory to regular stay alive as they're no longer parented to a row pending deletion.
Fixes #6938