I think you can shorten a bit your code
to get your main widget:

from PySide import QtGui

qwindow = QtGui.qApp.activeWindow()


my_widget_found=qwindow.findChildren(MyModule.submodule.TheWidgetClassName)

# Result: [<MyModule.submodule.TheWidgetClassName object at 0x5b8cbd8>]


this was my 2cents of something that will definitely not help you to get
your Panel as floating panel :P

sorry

On Mon, Jan 30, 2017 at 12:28 AM, Frank Rueter|OHUfx <[email protected]>
wrote:

> Looks like this does the trick, though it seems somewhat brute force:
>
> from PySide import QtGui for widget in QtGui.QApplication.allWidgets():
> name = widget.objectName() if name == 'com.nukepedia.nuBridge':
> stackedWidget = widget.parentWidget() 
> stackedWidget.setCurrentIndex(stackedWidget.indexOf(widget))
> break
>
> I will roll with that for now but if anybody has a more elegant solution
> I'm all ears.
>
> Cheers, frank
> On 30/01/17 11:09 AM, Frank Rueter|OHUfx wrote:
>
> Hi all, does anybody know if it's possible to float a docked QT panel via
> python? E.g. the equivalent of ctrl+click on the tab? I am just working on
> the nuBridge <https://vimeo.com/channels/nukepedia/165747936> again and
> would like to make it so that the user can call it from the help menu as
> well as create a custom panel as part of the workspace. I got all that in
> place but the challenge arises when trying to only use one instance of the
> panel (i.e. singleton). In that case, when the panel is already docked
> somewhere, and the user calls it from the help menu, I want the panel to
> either float, or at least come to the foreground (if it's a background tab
> at that point). Any ideas how to do that? I can't find native nuke commands
> for this so will try and dig into the QT widgets to see if I can force this
> behaviour. Cheers, frank
> --
> [image: ohufxLogo 50x50] <http://www.ohufx.com> *vfx compositing
> <http://ohufx.com/compositing.html> | workflow customisation and consulting
> <http://ohufx.com/customising.html> *
>
> _______________________________________________
> Nuke-python mailing [email protected], 
> http://forums.thefoundry.co.uk/http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
>
>
> _______________________________________________
> Nuke-python mailing list
> [email protected], http://forums.thefoundry.co.uk/
> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
>
>


-- 
Matthieu Cadet
Compositor Artist & TD,
nWave Digital
[email protected]
_______________________________________________
Nuke-python mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python

Reply via email to