title: How to bring keyboard focus to QTextEdit in PyQt?
body: <p>I've inserted a simple <code>QTextEdit</code> widget into my PyQt user interface. When the user wants to type text into that widget, he has to click on it. My program should be able to make this happen automatically at certain occasions, such that the user can start typing text into that <code>QTextEdit</code> widget without the need for clicking on it.</p>
  
  <p>I already got somewhere, but the issue is still not solved completely. When my program calls the <code>focus()</code> function, the cursor will start blinking at the end of the last line. But typing on your keyboard doesn't insert any text.</p>
  
  <pre><code>    class myTextField(QPlainTextEdit):
  
          def __init__(self):
              super(myTextField, self).__init__()
              ...
  
  
          def focus(self):
              self.focusInEvent(QFocusEvent( QEvent.FocusIn ))
              # Now the cursor blinks at the end of the last line.
              # But typing on your keyboard doesn't insert any text.
              # You still got to click explicitly onto the widget..
  
          ...
  
      ###
  </code></pre>
  
  <p>Any help is greatly appreciated :-)</p>