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

Reply via email to