Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
6.5.6, 6.7.2, 6.8.0 Beta4
-
Windows 10 22H2, MSVC 2022 x64
-
-
53df22b42 (dev), 351b5b3e9 (6.8)
Description
Code
#include <QApplication> #include <QFileDialog> int main(int argc, char *argv[]) { QApplication app(argc, argv); QFileDialog d; d.setOption(QFileDialog::DontUseNativeDialog, true); d.setFileMode(QFileDialog::Directory); d.exec(); return 0; }
Steps to reproduce
- Build and run the code above
- In the dialog, click the "New Folder" button
- Enter a name with a trailing space (like "Bad ") and accept it
- Click on a folder
- Try to delete "Bad "
Unexpected Outcomes
- (Step #3) "Bad " does not have a folder icon in the non-native QFileDialog, unlike other folders
- (Step #4) The non-native QFileDialog shows two separate entries for the newly-created folder, one with the trailing space and one without. Clicking on the former entry will highlight both entries.
- (Step #5) If we try to delete "Bad " via the non-native QFileDialog, we get a confirmation dialog but nothing happens if we accept
Notes
See https://superuser.com/questions/565334/rename-delete-windows-x64-folder-with-leading-and-trailing-space - Windows doesn't really like folders with trailing spaces. Fortunately, there are (convoluted) ways to remove them.