title: PyQt GUI order of operations
body: <p>I have a following problem:</p>
  
  <p>upon pressing a button in PyQt made GUI I have to do two actions:</p>
  
  <ol>
  <li>Immediately update a QTextBrowser</li>
  <li>Run a method that will wait for some time and enable some buttons after.</li>
  </ol>
  
  <p>What I get is that 1 and 2 are done at the same time, after a waiting period.</p>
  
  <p>Part of the code is:</p>
  
  <pre><code>    #in the signals definition...
      signalUpdateProgressDialog = QtCore.pyqtSignal(str) # signal definition
  
      #in the connections definition...
      self.btnStopOpt.clicked.connect(self.clickStop1)
      self.btnStopOpt.clicked.connect(self.clickStop)
  
  def updateProgressDialog(self, dialog):
      self.ProgressDialog.setHtml(dialog)
  
  def clickStop1(self):
      # notify
      self.signalUpdateProgressDialog.emit('Message')
  
  def clickStop(self):
  
      # shut down thread...
  
      print "Thread Stopped"
  
      time.sleep(5)
      # enable run button
      self.btnRun.setEnabled(True)
  </code></pre>
  
  <p>I tried all in one clickStop method, I tried with and without emiting signal for updateProgress. Always, GUI is refreshed only after the waiting period.</p>
  
  <p>Nevertheless, I encountered this problem before, I think I do not understand how it works with the GUI. In general, how to get the required behaviour: GUI is updated when the code line is executed?</p>