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 attribute to point to proper magicgui widget parent #583

Merged
merged 4 commits into from
Oct 4, 2023

Conversation

tlambert03
Copy link
Member

@tlambert03 tlambert03 commented Sep 6, 2023

fixes #582
closes #456
This PR fixes widget.parent behavior to point to the containing magicgui Container rather than the backend widget. The implementation is a bit hacky, and currently only works for the qt backend. But it's giving the desired behavior in tests.

@brisvag ... I believe this is something we've discussed as well. If you have a moment to take a peek and confirm that this at least moves us in the right direction, I would appreciate it!

@codecov
Copy link

codecov bot commented Sep 6, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (c578b61) 87.60% compared to head (b3c37a5) 87.64%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #583      +/-   ##
==========================================
+ Coverage   87.60%   87.64%   +0.03%     
==========================================
  Files          39       39              
  Lines        4551     4557       +6     
==========================================
+ Hits         3987     3994       +7     
+ Misses        564      563       -1     
Files Coverage Δ
src/magicgui/backends/_ipynb/widgets.py 64.55% <ø> (+0.27%) ⬆️
src/magicgui/backends/_qtpy/widgets.py 87.41% <100.00%> (+0.09%) ⬆️

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

@brisvag
Copy link
Contributor

brisvag commented Sep 7, 2023

Yup, in fact there's an issue about it :) #456

@tlambert03 tlambert03 added the bug Something isn't working label Oct 4, 2023
@tlambert03 tlambert03 enabled auto-merge (squash) October 4, 2023 14:41
@tlambert03 tlambert03 merged commit edf00f7 into pyapp-kit:main Oct 4, 2023
32 checks passed
@tlambert03 tlambert03 deleted the fix-parent branch October 4, 2023 14:43
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.

Container.parent type annotation incorrect Expose parent Container to children
2 participants