SUMMARY When using `QFileDialog::getExistingDirectory` with a hidden path as starting path, it falls back to the user's home directory. STEPS TO REPRODUCE 1. call `QFileDialog::getExistingDirectory(this, "", "/home/user/.config"); OBSERVED RESULT It opens the user's home directory EXPECTED RESULT It opens the given hidden directory SOFTWARE/OS VERSIONS Linux/KDE Plasma: Fedora Linux 42 KDE KDE Plasma Version: 6.4.5 KDE Frameworks Version: 6.19.0 Qt Version: 6.9.2
As an important addendum: kdialog --getexistingdirectory /home/user/.config works, and has a different implementation not calling QFileDialog::getExistingDirectory. https://invent.kde.org/utilities/kdialog/-/blob/master/src/kdialog.cpp?ref_type=heads#L828
Works with other platformthemes
getExistingDirectory(Url) passes the dir in the constructor https://invent.kde.org/qt/qt/qtbase/-/blob/dev/src/widgets/dialogs/qfiledialog.cpp#L2581 so as expected QFileDialog d(nullptr, QString(), "/home/david/.config"); d.setFileMode(QFileDialog::Directory); d.show(); reproduces the bug. As noted by Oliver the following works as expected and as a side effect shows all hidden directories: QFileDialog d(nullptr); d.setFileMode(QFileDialog::Directory); d.setDirectory("/home/david/.config"); d.show();
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-integration/-/merge_requests/190
Git commit fce65181729f862cead091d6bab66ee10fa9882c by David Redondo. Committed on 16/10/2025 at 10:14. Pushed by davidre into branch 'master'. KDirSelectDialog: Strip trailing slash for hidden check If there's a trailing slash fileName return an empty string. FIXED-IN:6.4.6 M +1 -2 qt5/src/platformtheme/kdirselectdialog.cpp M +1 -2 qt6/src/platformtheme/kdirselectdialog.cpp https://invent.kde.org/plasma/plasma-integration/-/commit/fce65181729f862cead091d6bab66ee10fa9882c
Git commit 00c3cc5120febae4f9a175dddd62013dbf92d872 by David Redondo. Committed on 16/10/2025 at 10:20. Pushed by davidre into branch 'Plasma/6.5'. KDirSelectDialog: Strip trailing slash for hidden check If there's a trailing slash fileName return an empty string. FIXED-IN:6.4.6 (cherry picked from commit fce65181729f862cead091d6bab66ee10fa9882c) Co-authored-by: David Redondo <kde@david-redondo.de> M +1 -2 qt5/src/platformtheme/kdirselectdialog.cpp M +1 -2 qt6/src/platformtheme/kdirselectdialog.cpp https://invent.kde.org/plasma/plasma-integration/-/commit/00c3cc5120febae4f9a175dddd62013dbf92d872
Git commit 3d5fb47b6e3adddd0acabbdc51a7f5bc697eef75 by David Redondo. Committed on 16/10/2025 at 10:33. Pushed by davidre into branch 'Plasma/6.4'. KDirSelectDialog: Strip trailing slash for hidden check If there's a trailing slash fileName return an empty string. FIXED-IN:6.4.6 (cherry picked from commit fce65181729f862cead091d6bab66ee10fa9882c) Co-authored-by: David Redondo <kde@david-redondo.de> (cherry picked from commit 00c3cc5120febae4f9a175dddd62013dbf92d872) Co-authored-by: David Redondo <kde@david-redondo.de> M +1 -2 qt5/src/platformtheme/kdirselectdialog.cpp M +1 -2 qt6/src/platformtheme/kdirselectdialog.cpp https://invent.kde.org/plasma/plasma-integration/-/commit/3d5fb47b6e3adddd0acabbdc51a7f5bc697eef75