I want to connect the "x" button on my program's main window with a function that I created. I know how to do it in wxPython:
self.Bind(wx.EVT_CLOSE, self.onQuit)
self.Bind(wx.EVT_CLOSE, self.onQuit)
To copy to clipboard, switch view to plain text mode
But I can't figure out how to do it with PyQt4. I've tried:
self.connect(self, Qt.SIGNAL('quit()'), self.onQuit)
self.connect(self, Qt.SIGNAL('quit()'), self.onQuit)
To copy to clipboard, switch view to plain text mode
and
self.connect(self, Qt.SIGNAL('destroyed()'), self.onQuit)
self.connect(self, Qt.SIGNAL('destroyed()'), self.onQuit)
To copy to clipboard, switch view to plain text mode
Bookmarks