title: pyqt4: How to change button event without adding a new event?
body: <p>I have a click button that I want to change events when the button is pressed. A minimal version of the existing code looks like this:</p>
  
  <pre><code># Event that happens the first time
  def first_event(self):
      button.setText("Second Event")
      button.clicked.connect(second_event)
  
  # Event that happens the second time
  def second_event(self):
      button.setText("First Event")
      button.clicked.connect(first_event)
  
  button = QtGui.QPushButton("First Event")
  button.clicked.connect(first_event)
  </code></pre>
  
  <p>Unfortunately, instead of <strong>changing</strong> the event that happens, it simply <strong>adds</strong> and event to the clicked signal, meaning that the following happens:</p>
  
  <p>First button press - calls first_event</p>
  
  <p>Second button press - calls first_event and second_event</p>
  
  <p>Third button press - calls first_event twice and second_event</p>
  
  <p>etc...</p>
  
  <p>My desired behavior would be to have the button <strong>change functions when it is pressed</strong>, so that the resulting behavior would be:</p>
  
  <p>First button press - calls first_event</p>
  
  <p>Second button press - calls second_event</p>
  
  <p>Third button press - calls first_event</p>
  
  <p>etc...</p>
  
  <p>Is there a way to make it so that it changes the click event instead of adding a new one? Is there a way to remove events after the fact?</p>