Skip to content
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

fix: fix parent_changed signal, and rename to native_parent_changed #628

Merged
merged 7 commits into from
Feb 14, 2024

Conversation

tlambert03
Copy link
Member

This fixes #627 by properly including the widget.native.parent() as the first argument of the signal.

However, that signal name is rather confusing, since Widget.parent now mean a magicgui.widgets.Container (see #582 and #456). So, this PR also renames it as native_parent_changed, to make clearer that what the callback will receive is the native object and not a magicgui container parent. (parent_changed is retained as a deprecated alias).

This means that after widget.native_parent_changed has been emitted with a non-null value, it is still quite possible that widget.parent will be None if it is not inside of a magicgui Container. However, widget.native.parent() will not be None.

cc @aeisenbarth. hope this will help you. let me know if you have any thoughts

@aeisenbarth
Copy link
Contributor

Looks good to me, thank you!

Copy link

codecov bot commented Feb 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (bdda89f) 87.71% compared to head (6e1202c) 87.69%.
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #628      +/-   ##
==========================================
- Coverage   87.71%   87.69%   -0.02%     
==========================================
  Files          40       40              
  Lines        4721     4723       +2     
==========================================
+ Hits         4141     4142       +1     
- Misses        580      581       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tlambert03 tlambert03 merged commit 3e10552 into pyapp-kit:main Feb 14, 2024
34 checks passed
@tlambert03 tlambert03 deleted the fix-parent-changed branch February 14, 2024 01:41
@tlambert03 tlambert03 added the bug Something isn't working label Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No parent with parent_changed
2 participants