Skip to content

Tools: show functions returning QWidget - #1856

Merged
iLLiCiTiT merged 4 commits into
developfrom
enhancement/return-tools-widgets-when-shown
Jun 1, 2026
Merged

Tools: show functions returning QWidget#1856
iLLiCiTiT merged 4 commits into
developfrom
enhancement/return-tools-widgets-when-shown

Conversation

@antirotor

Copy link
Copy Markdown
Member

Changelog Description

Make all show_*() functions to return QWidget so the code calling it can work with it. Also add some type annotations and docstrings.

Additional info

This is needed for example in Unreal, where you need to call unreal.parent_external_window_to_slate() on winId() of the widget. Might be useful for other things too.

Tip

For PR that can make use of it, see ynput/ayon-unreal#269

Testing notes:

Without proper support this cannot be easily tested. However, all should work as before.

make all `show_*()` function to return QWidget so the code calling it can work with it. Also add some type annotations and docstrings.
@antirotor
antirotor requested review from BigRoy and iLLiCiTiT May 25, 2026 12:04
@antirotor antirotor self-assigned this May 25, 2026
@antirotor antirotor added size/XS type: enhancement Improvement of existing functionality or minor addition labels May 25, 2026
@ynbot ynbot added size/S and removed size/XS labels May 25, 2026

@iLLiCiTiT iLLiCiTiT left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code changes look ok, can't verify them.

I would personally NOT do it, and rather force Unreal to use get_* methods to handle that.

Comment thread client/ayon_core/tools/utils/host_tools.py Outdated
Comment thread client/ayon_core/tools/utils/host_tools.py Outdated
@ynbot ynbot moved this to Review In Progress in PR reviewing May 25, 2026
@github-project-automation github-project-automation Bot moved this from Review In Progress to Merge Requested in PR reviewing May 25, 2026
@ynbot ynbot moved this from Merge Requested to Review In Progress in PR reviewing May 25, 2026
Comment thread client/ayon_core/tools/utils/host_tools.py Outdated
Comment thread client/ayon_core/tools/utils/host_tools.py Outdated
Comment thread client/ayon_core/tools/utils/host_tools.py Outdated
Comment thread client/ayon_core/tools/utils/host_tools.py Outdated
Comment thread client/ayon_core/tools/utils/host_tools.py Outdated
Comment thread client/ayon_core/tools/utils/host_tools.py Outdated
Comment thread client/ayon_core/tools/utils/host_tools.py Outdated
Comment thread client/ayon_core/tools/utils/host_tools.py Outdated
Comment thread client/ayon_core/tools/utils/host_tools.py Outdated
Comment thread client/ayon_core/tools/utils/host_tools.py Outdated
Comment thread client/ayon_core/tools/utils/host_tools.py Outdated
Comment thread client/ayon_core/tools/utils/host_tools.py Outdated
Comment thread client/ayon_core/tools/utils/host_tools.py Outdated
Comment thread client/ayon_core/tools/utils/host_tools.py Outdated
Comment thread client/ayon_core/tools/utils/host_tools.py Outdated
Comment thread client/ayon_core/tools/utils/host_tools.py Outdated
Comment thread client/ayon_core/tools/utils/host_tools.py Outdated
Comment thread client/ayon_core/tools/utils/host_tools.py Outdated
Comment thread client/ayon_core/tools/utils/host_tools.py Outdated
Comment thread client/ayon_core/tools/utils/host_tools.py Outdated
Comment thread client/ayon_core/tools/utils/host_tools.py Outdated
Comment thread client/ayon_core/tools/utils/host_tools.py Outdated
Comment thread client/ayon_core/tools/utils/host_tools.py Outdated
Comment thread client/ayon_core/tools/utils/host_tools.py Outdated
Comment thread client/ayon_core/tools/utils/host_tools.py Outdated

@BigRoy BigRoy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. I agree with essentially all of @iLLiCiTiT 's suggestions here - so after that looks good to me.

apply suggestions, remove unnecessary import
@antirotor

Copy link
Copy Markdown
Member Author

I would personally NOT do it, and rather force Unreal to use get_* methods to handle that.

but then you would basically need to reimplement all show_*() in unreal and perhaps elsewhere.

applied suggestions.

Comment thread client/ayon_core/tools/utils/host_tools.py Outdated
Comment thread client/ayon_core/tools/utils/host_tools.py Outdated
Comment thread client/ayon_core/tools/utils/host_tools.py Outdated
Comment thread client/ayon_core/tools/utils/host_tools.py Outdated
Comment thread client/ayon_core/tools/utils/host_tools.py Outdated
sorry for this but I need to read it
@github-project-automation github-project-automation Bot moved this from Review In Progress to Merge Requested in PR reviewing Jun 1, 2026
@iLLiCiTiT

iLLiCiTiT commented Jun 1, 2026

Copy link
Copy Markdown
Member

but then you would basically need to reimplement all show_*() in unreal and perhaps elsewhere.

Yeah, you kinda had to reimplement everything here instead...

@iLLiCiTiT
iLLiCiTiT merged commit f71064b into develop Jun 1, 2026
2 checks passed
@iLLiCiTiT
iLLiCiTiT deleted the enhancement/return-tools-widgets-when-shown branch June 1, 2026 15:15
@github-project-automation github-project-automation Bot moved this from Merge Requested to Done in PR reviewing Jun 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/S type: enhancement Improvement of existing functionality or minor addition

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants