title: PyQt: RuntimeError: wrapped C/C++ object has been deleted
body: <p>If I run this code:</p>
  
  <pre><code>    #!/usr/local/bin/    python3
  
  import sys 
  from PyQt4.QtCore import *
  from PyQt4.QtGui import *
  
  
  class Window(QMainWindow):
  
      def __init__(self):
          super().__init__()
          self.button1 = QPushButton("1")
          self.button2 = QPushButton("2")
          self.setCentralWidget(self.button1)
          self.button1.clicked.connect(lambda: self.setCentralWidget(self.button2))
          self.button2.clicked.connect(lambda: self.setCentralWidget(self.button1))
          self.show()
  
  if __name__ == '__main__':
  
      import sys 
      app = QApplication(sys.argv)
      window = Window()
      sys.exit(app.exec_())
  </code></pre>
  
  <p>...I get this output:</p>
  
  <pre><code>Traceback (most recent call last):
    File "test.py", line 16, in &lt;lambda&gt;
      self.button2.clicked.connect(lambda: self.setCentralWidget(self.button1))
  RuntimeError: wrapped C/C++ object of type QPushButton has been deleted
  </code></pre>
  
  <p>I do not understand why the object is being deleted. Window should maintain a reference to it.
  I have thoroughly investigated these posts:
  <a href="https://stackoverflow.com/questions/6002895/understanding-the-underlying-c-c-object-has-been-deleted-error">Understanding the “underlying C/C++ object has been deleted” error</a>
  <a href="https://stackoverflow.com/questions/5122451/can-a-pyqt4-qobject-be-queried-to-determine-if-the-underlying-c-instance-has-b?rq=1">Can a PyQt4 QObject be queried to determine if the underlying C++ instance has been destroyed?</a></p>
  
  <p>Why is the button being deleted?</p>