Skip to content

PlugLayout : Prevent widgets being deleted when no longer accessories - #7125

Merged
johnhaddon merged 1 commit into
GafferHQ:1.6_maintenancefrom
murraystevenson:plugLayoutRemoveAccessoryFix
Aug 27, 2026
Merged

PlugLayout : Prevent widgets being deleted when no longer accessories#7125
johnhaddon merged 1 commit into
GafferHQ:1.6_maintenancefrom
murraystevenson:plugLayoutRemoveAccessoryFix

Conversation

@murraystevenson

Copy link
Copy Markdown
Contributor

This is an alternate take on the layout:accessory fix 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 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 _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

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
@murraystevenson murraystevenson self-assigned this Aug 27, 2026
@github-project-automation github-project-automation Bot moved this to Pending Review in Work in Progress Aug 27, 2026
@johnhaddon
johnhaddon merged commit 056b585 into GafferHQ:1.6_maintenance Aug 27, 2026
6 checks passed
@github-project-automation github-project-automation Bot moved this from Pending Review to Pending release in Work in Progress Aug 27, 2026
@johnhaddon

Copy link
Copy Markdown
Member

Thanks Murray - unparenting rather than adopting at the grandparent as in #6829 is definitely clearer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Pending release

Development

Successfully merging this pull request may close these issues.

2 participants