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
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
> --
> view archives: http://groups.google.com/group/python_inside_maya
> change your subscription settings: http://groups.google.com/group/python_inside_maya/subscribe
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.
Looks like I am creating the window differently than you guys.
I was going to give this skinning tool away free anyways, here's that
few surrounding chunks of code: http://pastebin.com/5tJfvSB7
Thanks,
CE
--
CE
In your example I would get this:
TypeError: ('Wrong base class of toplevel widget', (<class
'__main__.skinWrangler'>, 'QDialog'))
So I made it a QDialog and added this string from the docs:
def __init__(self):
>>>QtGui.QDialog.__init__(self)
Now it works fine! (the onClose)
CE