title: How to set input focus to a shown dialog in Qt?
body: <p>In a button click slot, I create and <code>exec()</code> a dialog with a NULL parent. Inside the dialog's constructor, I have:</p>
  
  <pre><code>this-&gt;activateWindow();
  this-&gt;raise();
  this-&gt;setFocus();
  </code></pre>
  
  <p>The dialog is application modal and has strong focus. However, it does NOT respond to keyboard events until I click on it. How do I make the dialog get focus without having to click it?</p>