title: Trying to update a textbox in pyqt while doing a calculation
body: <p>I used pyqt to build a little gui where you can choose a <code>Key</code> from a QComboBox and the <code>Value</code> is taken to do a math calculation that usually takes 3 seconds and the result is a short string. I'm updating the calculated short string in the gui in a textbox. This is my code (I removed the math calculation code because it's not relevant), it is working so far:</p>
  
  <pre><code>import sys
  from PyQt4.QtCore import *
  from PyQt4.QtGui import *
  import os 
  dict1 = {"Key":Value, "Key2":Value2, "Key3":Value3} # Value are int's
  
  class combodemo(QWidget):
    def __init__(self, parent = None):
      super(combodemo, self).__init__(parent)
  
      layout = QHBoxLayout()
      self.cb = QComboBox()
      self.cb.addItems([key for key in sorted(dict1.keys())])
      self.cb.currentIndexChanged.connect(self.selectionchange)
  
      layout.addWidget(self.cb)
      self.setLayout(layout)
      self.cb.textbox = QLineEdit(self)
      self.cb.textbox.move(100, 200)
      self.cb.textbox.resize(150,50)
      self.cb.textbox.setAlignment(Qt.AlignCenter)
      self.cb.textbox.setText("Initial Text")
  
    def selectionchange(self):
      #self.cb.textbox.setText("Calculating...") # THIS IS NOT WORKING
      self.cb.currentIndexChanged.connect(self.selectionchange)
      # MATH CALCULATION CODE GOES HERE[...]
      self.cb.textbox.setText("RESULT OF MATH CALCULATION")
  
  def main():
    app = QApplication(sys.argv)
    ex = combodemo()
    ex.show()
    sys.exit(app.exec_())
  
  if __name__ == '__main__':
    main()
  </code></pre>
  
  <p>Right now the program freezes for 3 seconds after a <code>Key</code> is selected (because of the math calculation I am doing). Since my math calculation takes 3 seconds, I would like to update the textbox to <code>"Calculating..."</code> once a <code>Key</code> from the QComboBox is selected. So while my math calculation is performed I want the textbox to show <code>"Calculating..."</code>. Once the calculation is done it should simple rewrite the textbox and show the math result.</p>
  
  <p>In the above code I tried to achieve it in the function <code>def selectionchange(self)</code> right at the beginning (it's uncommented). But it has no effect. How can I make this work?</p>