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:
Qt Code:
  1. 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:
Qt Code:
  1. self.connect(self, Qt.SIGNAL('quit()'), self.onQuit)
To copy to clipboard, switch view to plain text mode 
and
Qt Code:
  1. self.connect(self, Qt.SIGNAL('destroyed()'), self.onQuit)
To copy to clipboard, switch view to plain text mode