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

QFileDialog::setMimeTypeFilters gives weird results on mac

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.15.2
    • None
    • macOS

    Description

      I created a file dialog as follows:

          QFileDialog dialog(parent, title, dir);
          QStringList filters;
          for ( const auto& baf : QImageReader::supportedMimeTypes() )
              filters.push_back(QString(baf));
          dialog.setMimeTypeFilters(filters);
      
          dialog.setAcceptMode(QFileDialog::AcceptOpen);
          dialog.setFileMode(QFileDialog::ExistingFile);
      

      It works fine on Windows/Linux but on Mac has a weird effect.
      There it seems the actual filter is offset compared what the dropdown shows.
      I attached some screenshots to illustrate:


      The png file isn't active when the PNG filter is selected, but it becomes enabled when the SVG filter is enabled. It seems to be a trend for all filters: that they show the files from the filter above them in the drop down.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            glax Mattia Basaglia
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes