pyblish / pyblish-qml

Pyblish QML frontend for Maya 2013+, Houdini 11+, Nuke 8+ and more
GNU Lesser General Public License v3.0
114 stars 44 forks source link

Faking QML GUI as host window's child #259

Closed davidlatwe closed 7 years ago

davidlatwe commented 7 years ago

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 commented 7 years ago

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

tokejepsen commented 7 years ago

Can confirm it works in Nuke :)

aug 23 2017 12-59 pm

mottosso commented 7 years ago

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 commented 7 years ago

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

davidlatwe commented 7 years ago

Really glad it helps!!

davidlatwe commented 7 years ago

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 commented 7 years ago

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!