title: Qt non-blocking overlay dialog
body: <p>I would like to make a dialog in Qt 4.8 that is non-blocking to the parent dialog but stays on top of it while open.</p>
  
  <p>What I tried so far:</p>
  
  <h1>Parent</h1>
  
  <p>The following code does exactly what I want on Gnome but on Windows/Mac the dialog goes to the back when the main window gains the focus:</p>
  
  <pre><code>QMainWindow* window = new QMainWindow();
  QDialog* dialog = new QDialog( window );
  
  window-&gt;show();
  dialog-&gt;show();
  </code></pre>
  
  <h1>Always on top</h1>
  
  <p>There is also the possibility to make the dialog always on top but I don't think that my application will be so incredibly important to the user that he wants it to be always on top:</p>
  
  <pre><code>dialog-&gt;setWindowFlags( dialog-&gt;windowFlags() | Qt::WindowStaysOnTopHint );
  </code></pre>
  
  <h1>Modal dialog</h1>
  
  <p>There is also the possibility to make a window modal dialog. But that blocks user interaction with the main window while the dialog is open.</p>
  
  <pre><code>dialog-&gt;setWindowModality( Qt::WindowModal );
  </code></pre>
  
  <h1>Dock widget</h1>
  
  <p>A dock widget does pretty much what it should. But it also docks and does not look like a dialog.</p>
  
  <p>What am I looking for?</p>