Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-131277

Non-native file dialogs break with the new Mime Database

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P2: Important P2: Important
    • None
    • 6.8.0
    • None
    • 906289aaf (15.0)

      #include <QApplication>
      #include <QFileDialog>
      #include <QTimer>
      #include <QMimeDatabase>
      
      int main(int argc, char *argv[])
      {
          QApplication a(argc, argv);
          QMimeDatabase db;
          QString filter = db.mimeTypeForName("text/plain").filterString();
          QFileDialog::getOpenFileName(nullptr, {}, {}, filter, nullptr, QFileDialog::Option::DontUseNativeDialog);
          return 0;
      } 

      The new mime database is very thorough when it comes to filter strings. Using them in a QFileDialog with "DontUseNativeDialog" though breaks the file dialog as it tries to use its sizeHint, which gets humongous from the long entry in the Combobox.

        For Gerrit Dashboard: QTBUG-131277
        # Subject Branch Project Status CR V

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            madwinter Marcus Tillmanns
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes