title: QDialog not positioned correctly
body: <p>I have a problem with QDialog which is not displayed centered on the parent window.
  The following snippet explains it:</p>
  
  <pre><code>void MyWidget::showDialog() {
      QObject* p = parent();
      while (p!=0) {
          qDebug() &lt;&lt; p;
          p = p-&gt;parent();
      }
      qDebug() &lt;&lt; QApplication::activeWindow();
  
      MyClassDerivedFromQDialog dlg( this );
      if ( dlg.exec() != dlg.Accepted ) {
          return;
      }
      ... do something
  }
  </code></pre>
  
  <p>The output on qDebug is the following</p>
  
  <pre><code>QSplitter(0x2d89930, name = "splitter") 
  MyWidget(0x2d89670, name = "widget") 
  MainWindow(0x27ef20, name = "application")
  MainWindow(0x27ef20, name = "application")
  </code></pre>
  
  <p>Executing my example opens the dialog somewhere on the screen. Passing QApplication::activeWindow() as a parent to the dialogs constructor results in a dialog centered on the main window. So why is that and how to track down the problem?</p>