I don't know if you've checked out nukescripts.registerWidgetAsPanel yet, but it might be right up your alley. I haven't had much chance to play around in 6.3 yet, so it may be overkill for a modal popup, but there's only one way to find out...

-Nathan

-----Original Message----- From: Gerard Keating
Sent: Monday, August 08, 2011 5:22 AM
To: Nuke Python discussion
Subject: [Nuke-python] Re: Nuke6.3v1 and pyqt from menu bar

Hi,
So I think I figured this out. The QLabel object no longer exists
outside the scope of the function so when the funciton returns it
cleans up and deletes the QLabel object. One way around this which I
found from the pyQtRender2 example is to add a nuke callback that
calls the QLabel(makes more sense here if we are talking about
dialogs) object hence keeping it alive. I am sure there is a better
solution but that works for me.
Regards,
Gerard Keating.

On 8 August 2011 12:50, Gerard Keating <[email protected]> wrote:
Hi,
I am just trying to show a pyqt panel from the menu bar without using
pyQtAppUtils.py helper functions because they are no longer necessary
according to the documentation in nuke6.3v1 64 bit on linux.
So I have this in my menu.py :


def showPanel():
   from PyQt4 import QtGui
   nuke.tprint("Showing panel")
   label = QtGui.QLabel( "Hello World" )
   label.show()
   nuke.tprint("Finished showing panel")
menubar = nuke.menu('Nuke')
fileMenu = menubar.findItem('File')
fileMenu.addCommand("Test panel", showPanel)

But the label does not stay on the screen.
I am probably doing something stupid but can anyone see what it is?
Thanks,
Gerard Keating

_______________________________________________
Nuke-python mailing list
[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

Reply via email to