title: PyQt: Set text in a QLabel adding letter by letter
body: <p>I'm trying to create an application that displays the contents of a <code>QLabel</code> (or a <code>QTextEdit</code>) by adding the letters one by one (as if the application were writing them).</p>
  
  <p>This is an example in python:</p>
  
  <pre><code>import os, time
  
  def write(text, time):
      base = ""
      for char in text:
          os.system("clear")
          base += char
          print base
          time.sleep(time)
  
  def main():
      text = "this is a test"
      write(text, 0.05)
  </code></pre>
  
  <p>This is my PyQt code:</p>
  
  <pre><code>from PyQt4 import QtCore, QtGui
  import sys
  
  class Example(QtGui.QWidget):
      def __init__(self):
          QtGui.QWidget.__init__(self)
  
          self.initUi()
  
          text = "this is a test"
          self.write(text, 50)
  
      def initUi(self):
          self.setGeometry(300, 300, 250, 150) 
          self.show()
  
          self.label = QtGui.QLabel(self)
          self.label.move(120, 60)
  
      def write(self, text, msec):
          base = ""
          for char in text:
              base += char
              self.label.setText(base)
              QtCore.QThread.msleep(msec)
  
  if __name__ == "__main__":
      app = QtGui.QApplication(sys.argv)
      ex = Example()
      ex.show()
      sys.exit(app.exec_())
  </code></pre>
  
  <p>This code, obviously, doesn't work - but I have no idea how to do this "simple" thing.</p>