On Wed, 18 Aug 2010 08:43:00 -0700 (PDT), dizou <[email protected]> wrote: > I have a QMainWindow that spawns another QMainWindow. When the second > QMainWindow is closed by the x button in the upper right corner, I want > some > stuff to happen in the first QMainWindow. This is what I have: > > class MainWindow(QMainWindow): > def __init__(self): > QMainWindow.__init__(self) > def EnterDrawMode(self): > drawWindow = DrawWindow(self) > drawWindow.show() > self.connect(drawWindow, SIGNAL("destroyed()"), self.Test) > def Test(self): > print "exit" > #do stuff > > class DrawWindow(QMainWindow): > def __init__(self, parent): > QMainWindow.__init__(self, parent) > self.setObjectName("DrawWindow") > self.setFixedSize(200, 200) > > However, when I close DrawWindow, nothing happens. What am I doing wrong?
Closing a window doesn't necessarily destroy it. Check the WA_DeleteOnClose widget attribute. Phil _______________________________________________ PyQt mailing list [email protected] http://www.riverbankcomputing.com/mailman/listinfo/pyqt
