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

Widgets-based QFileDialog does not display files matching *.txt when setting mime type to "text/plain"

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.6.0 RC
    • 5.6.0 Alpha
    • None
    • XCB,Windows
    •  2117a76136e6e3e48f70d7a444b06c0ee0ff9ec4 (qtbase/5.6, 28.8.2015, 5.6)

    Description

      • touch a foo.txt and foo.html
      • Run the sample program
      • Note foo.txt is not shown whereas foo.html is when switching the filter to HTML
        #include <QApplication>
        #include <QFileDialog>
        #include <QMimeDatabase>
        #include <QDebug>
        
        int main(int argc, char *argv[])
        {
            QApplication a(argc, argv);
        
            QFileDialog fileDialog(0, "Open File...");
            fileDialog.setOption(QFileDialog::DontUseNativeDialog);
            fileDialog.setAcceptMode(QFileDialog::AcceptOpen);
            fileDialog.setFileMode(QFileDialog::ExistingFile);
            fileDialog.setMimeTypeFilters(QStringList() << "text/plain"<< "text/html");
            fileDialog.exec();
            qDebug() << QT_VERSION_STR << fileDialog.selectedFiles();
            return 0;
        }
        

        Found while working on https://codereview.qt-project.org/#/c/124202/

      Attachments

        1. qtbug47923_diag.diff
          4 kB
        2. qtbug47923_log.txt
          2 kB
        3. qtbug47923.zip
          1.0 kB

        Issue Links

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

          Activity

            People

              kleint Friedemann Kleint
              kleint Friedemann Kleint
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes