title: How can I move the keyboard cursor/focus to a QLineEdit?
body: <p>I am opening a QDialog which contains a QLineEdit. I want the QLineEdit to have keyboard focus initially, with the blinking cursor as a visual cue. Simple, right?</p>
  
  <p>Calling <code>line_edit-&gt;setFocus()</code> has no effect.</p>
  
  <p>Calling <code>line_edit-&gt;grabKeyboard()</code> gives it input focus BUT</p>
  
  <ul>
  <li>the blinking caret doesn't move to <code>line_edit</code></li>
  <li>if I click into a different QLineEdit, the blinking caret goes <em>there</em> but keypresses are still delivered to <code>line_edit</code></li>
  </ul>
  
  <p>If I do neither, I have to click into <code>line_edit</code> to get the caret and input focus. Looking at the source code for <code>QLineEdit::mousePressEvent</code> it seems that the critical function is <code>QWidgetLineControl::moveCursor</code>, but that's not accessible via the public API and peeking further into the source doesn't show anything promising.</p>
  
  <p>So how do I move the damn keyboard input cursor?</p>