title: Adding QFileDialog as a widget inside another QDialog
body: <p>I'm attempting to create a dialog which contains two child widgets: on the left side a <code>QFileDialog</code> instance so users can select files, and on the right side a separate widget which will be used to show a preview of the selected file if it is of a certain type.</p>
  
  <p>The problem is that the dialog opens up and I can see the "preview" widget just fine, but the <code>QFileDialog</code> is not showing up at all. </p>
  
  <p>This short example demonstrates my problem:</p>
  
  <pre><code>from PyQt5.QtWidgets import *
  from PyQt5.QtCore import *
  
  app = QApplication([])
  
  main_dialog = QDialog()
  main_dialog.setWindowTitle('My Dialog')
  layout = QHBoxLayout(main_dialog)
  
  file_dialog = QFileDialog(main_dialog, Qt.Widget)
  file_dialog.setOption(QFileDialog.DontUseNativeDialog)
  layout.addWidget(file_dialog)
  
  preview = QLabel('Preview', main_dialog)
  layout.addWidget(preview)
  
  main_dialog.show()
  
  app.exec_()
  </code></pre>
  
  <p>Some things that I've tried:    </p>
  
  <ol>
  <li>Add <code>file_dialog.show()</code> before/after <code>main_dialog.show()</code>: this shows up the <code>QFileDialog</code>, but in a different window; I want the file dialog to appear inside <code>main_dialog</code>, not as a separate window;</li>
  <li>Do not pass <code>Qt.Widget</code> to the <code>QFileDialog</code> constructor, to no effect;</li>
  <li>Do not pass <code>main_dialog</code> as parent to <code>QFileDialog</code>, again no effect;</li>
  <li>Change <code>main_dialog</code> to a <code>QWidget</code> just to see if it changed anything, it did not;</li>
  </ol>
  
  <p>I've searched the docs but did not find a suitable solution. </p>
  
  <p>Any hints? Also, suggestions on how to accomplish the task of allowing the user to select a file and display a preview of the file in the same window are welcome.</p>
  
  <p><strong>Context</strong>: this is a port of an old application written for Qt3. Qt3's <code>QFileSystem</code> dialog had this "preview" functionality built-in; I'm trying to reproduce the same functionality in Qt5.</p>
  
  <p><strong>Versions</strong></p>
  
  <ul>
  <li>Python 2.7</li>
  <li>PyQt 5.5.1</li>
  </ul>
  
  <p>I've also tried with Python 3.6 (from conda-forge) but obtained the same behavior.</p>