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

Faking QML GUI as host window's child #259

Merged
merged 2 commits into from
Aug 23, 2017
Merged

Faking QML GUI as host window's child #259

merged 2 commits into from
Aug 23, 2017

Conversation

davidlatwe
Copy link
Collaborator

@davidlatwe davidlatwe commented Aug 23, 2017

Make QML GUI acts like host main window's child window

This PR intend to provide a alternative way to "Parent window to host"

By installing an eventFilter to the host main window,
and connect show, hide, activate and deactivate events to QML app.

Currently tested in maya 2016-2017, and Houdini 16

Here is a demo.

Hope this help !

@mottosso
Copy link
Member

Thanks you so much @DavidPower! This is amazing, I will try this out now.

@tokejepsen
Copy link
Member

Can confirm it works in Nuke :)

aug 23 2017 12-59 pm

@mottosso
Copy link
Member

Works here too. Apart from the minor bug from your gif, where when you focus QML followed by another floating window, QML appears behind Maya. A small detail. The overall functionality looks solid and feels like a real parented window. :)

Great job @DavidPower! I'm happy to merge this.

@mottosso
Copy link
Member

For completeness, this addresses issue number 1! The first issue ever submitted to the project, almost three years ago.

@davidlatwe
Copy link
Collaborator Author

Really glad it helps!!

@davidlatwe
Copy link
Collaborator Author

Currently it use host main window's QEvent.WindowActivate and QEvent.WindowDeactivate event to add or remove QML GUI's stayOnTopFlag.
So if only consider the host and other app's window, this should do the trick well.
But if something like Maya that has it's own float window, this will not work well. : (
I think this might need a real child window to achieve that, or other kind of windowFlag I guess.
Cheers !

@mottosso
Copy link
Member

But if something like Maya that has it's own float window, this will not work well. : (

It's safe to save that for a new PR in the future once we've given this a spin. I increased the version and will merge now. Thanks again @DavidPower!

@mottosso mottosso merged commit 97f749c into pyblish:master Aug 23, 2017
@mottosso mottosso mentioned this pull request Aug 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants