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

Non-native file dialogs break with the new Mime Database

    XMLWordPrintable

Details

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

    Description

      #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.

      Attachments

        Issue Links

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

          Activity

            People

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

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes