Hi,
I'm experiencing a strange behavior with modal dialogs.
Let's see the following code snippet: (Im in a method's class context)
def launchDialog(self):
diag = QtGui.QDialog(self)
ret = diag.exec_()
print ret
I can see the dialog during a few miliseconds, then it disapears. The
return value is always 0
Now, another piece of code:
def launchDialog(self):
self.diag = QtGui.QDialog(self)
ret = self.diag.exec_()
print ret
I'm just adding the dialog as a member of the class. The dialog
becomes modal, but exec_() returns immediately.
I have the same problems with the convenience methods of
QtGui.QMessageBox and QtGui.QInputDialog, they are closed immediately
too...
I'm in a particular state in maya. I have two different GUI launched.
They both use pumpthread:
## LAUNCH APP
window = None
app = None
def LaunchApp():
global app
global window
pt.initializePumpThread()
app = QtGui.QApplication(sys.argv)
window = MyWindowClass()
window.show()
If only one GUI is launched, diag.exec_() doesn't disappear. :'( But I
really need to have multiple windows
I'm stuck! I don't know how to solve this. Perhaps I could instanciate
the QtApp in another module which would act as a singleton and share
the QApplication with the different GUI?
Thanks!
Pierre
--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/python_inside_maya
-~----------~----~----~----~------~----~------~--~---