Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.15.1, 5.15.14, 6.2.9, 6.5.1
-
MacBook Air 2020 (M1), macOS Ventura 13.4.1, Xcode 14.3
-
-
fd817c28a (dev), b814f73fb (6.7), cab9a6166 (6.6), d651cdb98 (dev), 5dabb905e (6.7), e47a811dc (tqtc/lts-6.5), 7a2aff560 (tqtc/lts-6.2)
Description
Code
#include <QApplication> #include <QFileDialog> #include <QDebug> int main(int argc, char *argv[]) { QApplication app(argc, argv); qDebug() << QFileDialog::getSaveFileName(nullptr, "Caption", "MyFile", "Archive (*.tar.gz)"); }
Expected results (Windows/Linux)
- The default filename in the dialog is "MyFile.tar.gz"
- If you manually change the filename in the dialog to "abc", the debug output shows "abc.tar.gz"
Actual results (macOS)
- The default filename in the dialog is "MyFile.gz"
- If you manually change the filename in the dialog to "abc", the debug output shows "abc.gz"
Original Report
Using QFileDialog::getSaveFileName() with a file filter of:
"All NASA/FUN3D files (*.b8.ugrid *.mapbc);;NASA/FUN3D b8.ugrid files (*.b8.ugrid);;NASA/FUN3D mapbc files (*.mapbc);;All files (*)"
If the user enters just a basename (no extension) in the dialog box, QFileDialog::getSaveFileName() returns basename.ugrid instead of the expected basename.b8.ugrid (the first filter's extension). The .b8 is getting culled by the dialog.
Linux and winOS both return basename.b8.ugrid as expected.
Attachments
Issue Links
- relates to
-
QTBUG-110027 Windows: QFileDialog::getSaveFileName() repeats extension if selected filename edited (native dialog)
-
- Closed
-
- resulted from
-
QTBUG-38303 OS X QFileDialog::getSaveFileName doesn't allow selection of file with extensions like .tar.gz
-
- Closed
-
-
QTBUG-44227 QFileDialog::getSaveFileName on mac os double file extension (i.e. *.tar.gz ) filter alert
-
- Closed
-