Details
-
Bug
-
Resolution: Done
-
P2: Important
-
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
Issue Links
- is duplicated by
-
QTBUG-47922 Widgets-based QFileDialog does not display files matching *.txt when setting mime type to "text/plain"
- Closed