title: Text edit always uppercase
body: <p>I'm writing a screenwriting application with PySide. What I want is to turn the characters to uppercase while the user is typing.</p>
  
  <p>The following piece of code gives a runtime error saying "maximum recursion depth exceeded" every time I add a character. I get what it means and why it's happening but is there a different way? </p>
  
  <pre><code>self.cursor = self.recipient.textCursor()
  self.cursor.movePosition(QTextCursor.StartOfLine)
  self.cursor.movePosition(QTextCursor.EndOfLine, QTextCursor.KeepAnchor)
  self.curtext = self.cursor.selectedText()
  if len(self.curtext) &gt; len(self.prevText):
      self.cursor.insertText(self.curtext.upper())
      self.cursor.clearSelection()
  self.prevText = self.curtext
  </code></pre>
  
  <p>The code above runs whenever the text in the text edit widget is changed. The if statment prevents the code from running when the user hasn't insert text.</p>