title: QMainWindow goes background after using QFileDialog
body: <p>I have a Qt application that loads some file after clicking on button. I am using QFileDialog to open files. Every time I close file dialog, the application main window (QMainWindow) is behind all other opened windows (internet browser, explorer etc.). Is this standard behaviour? And is there any way to prevent this? I tried </p>
  
  <pre><code>    // set always on top window
      Qt::WindowFlags flags = this-&gt;windowFlags();
      this-&gt;setWindowFlags(flags | Qt::WindowStaysOnTopHint);
  </code></pre>
  
  <p>but it causes that also file dialog is behind main window.</p>
  
  <p>Edited:
  Here is fragment of code to call file dialog (method that calls it is static method of my class LoadData):</p>
  
  <pre><code>void MainWindow::on_buttonIP_clicked()
  {
       loaded = LoadData::OpenFiles(IPFiles);
  }
  
  bool LoadData::openFiles(QStringList &amp;fileNames)
  {
      // open files dialog
      fileNames = QFileDialog::getOpenFileNames(0,
            tr("Open files"), "", "Text Files (*.txt *.dat *.points)");
  
      if (fileNames.isEmpty())
      {
          return false;
      }
  
      return true;
  }
  </code></pre>