title: How to make a file dialog support multiple types in a single window
body: <p>I am currently working on something that needs the user to select an excel sheet or CSV file on their computer. To do this, I would like to create a file dialog window (<code>QtWidgets.QFileDialog()</code>) that allows the user to select any file that is <code>*.csv</code>, <code>*.xls</code>, or <code>*.xlsx</code>. So far, I tried to do the following:</p>
  <pre><code>from PySide2 import QtWidgets
  
  dialog = QtWidgets.QFileDialog()
  # This only shows *.xlsx files
  dialog.setNameFilter('Data files (*.csv, *.xls, *.xlsx)')
  # This only shows *.xls or *.xlsx files
  dialog.setNameFilter('Data files (*.csv, *.xls*)')
  # This requires selecting file type first, instead of getting a single overview of supported files:
  dialog.setNameFilters([&quot;Excel spreadsheets (*.xls*)&quot;, &quot;Text CSV files (*.csv)&quot;])
  # This strategy is just a more elaborate version of the above
  dialog.setMimeTypeFilters([
      &quot;text/csv&quot;,
      &quot;application/vnd.openxmlformats-officedocument.spreadsheetml.sheet&quot;
  ])
  </code></pre>
  <p>None of these give me the result I want, namely a single popup that shows all three filetypes at the same time. This would be the same behaviour as the file open dialog in LibreOffice Calc has, when selecting 'Spreadsheets', for example (probably the same applies to Excel and such similar files)</p>
  <p>In short: is there a way using QtWidgets to create a file input dialog that works exactly like the following HTML dialog:</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;input type="file" accept=".xls,.xlsx,.csv" /&gt;</code></pre>
  </div>
  </div>
  </p>