[PyQt] Problem with destroyed() signal and QMainWindow

dizou di_zou at yahoo.com
Wed Aug 18 16:43:00 BST 2010


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?
-- 
View this message in context: http://old.nabble.com/Problem-with-destroyed%28%29-signal-and-QMainWindow-tp29472790p29472790.html
Sent from the PyQt mailing list archive at Nabble.com.



More information about the PyQt mailing list