title: Qt - Focus on a application that has lost focus?
body: <p>I would like to know if it's possible to focus on my application even if it has lost focus?</p>
  
  <p>My application is running a thread, and once I exit it, I would like to bring my window application to the front.<br>
  I've tried the following code, it works to focus on the widget I'd like to, but if you're on firefox, it will just flash once in taskbar, and don't focus :(</p>
  
  <pre><code>this-&gt;activateWindow();
  this-&gt;show();
  this-&gt;setFocus();
  </code></pre>
  
  <p>EDIT: This would do it, but I don't want my application stay on top... and if I remove the flag, it loses focus =/</p>
  
  <pre><code>this-&gt;setWindowFlags(Qt::WindowStaysOnTopHint);
  this-&gt;activateWindow();
  this-&gt;show();
  this-&gt;setFocus();
  </code></pre>
  
  <p>Thank you in advance for your answers.</p>