this works for me:
class tagUi(base_class, form_class):
def __init__(self, parent=getMayaWindow()):
# a bunch of crap here
self.scriptJobId = cmds.scriptJob( e= ["SelectionChanged",
self.selectionCallback], protected=True)
self.show()
def closeEvent(self, e):
"""
Kills the selectionChanged scriptjob and any other gui closed
event stuff
"""
if self.scriptJobId:
print 'killing scriptjob'
cmds.scriptJob(kill=self.scriptJobId, force=True)
super(tagUi, self).closeEvent(e)
can't remember where i found the basis for this code, but it's out
there somewhere on teh interwebs.
cheers,
chrisg
On 21 April 2012 09:25, Christopher Evans <[email protected]> wrote:
> First lemme start with: Is it possible to use closeEvent() in Maya? I
> cannot get that to work.
>
> Can someone tell me how to feed a custom pyqt mainWindow tool into the
> parent flag of a scriptjob?
>
> I have been looking all over teh internets, I think it involves SIP
> somehow.. all examples I have seen show QDialog, or mel/python
> commands UIs.
>
> Thanks,
>
> --
> CE
>
> --
> view archives: http://groups.google.com/group/python_inside_maya
> change your subscription settings:
> http://groups.google.com/group/python_inside_maya/subscribe
--
view archives: http://groups.google.com/group/python_inside_maya
change your subscription settings:
http://groups.google.com/group/python_inside_maya/subscribe