Details
-
Bug
-
Resolution: Done
-
P2: Important
-
None
-
4.8.3
-
None
-
Windows 7
Description
A result of https://bugreports.qt-project.org/browse/QTBUG-27225. QFileDialog::getOpenFileNames() should return slashes, not backslashes:
Qt uses "/" as a universal directory separator in the same way that "/" is used as a path separator in URLs. If you always use "/" as a directory separator, Qt will translate your paths to conform to the underlying operating system.
QFile also expects slashes:
QFile expects the file separator to be '/' regardless of operating system. The use of other separators (e.g., '\') is not supported.
#include <QApplication> #include <QFileDialog> #include <QDebug> int main(int argc, char* argv[]) { QApplication app(argc, argv); qDebug() << QFileDialog::getOpenFileNames(0, "Select files", QString(), "Any file (*.*)"); }
Attachments
Issue Links
- resulted from
-
QTBUG-27225 QFileDialog::getOpenFileNames returns filenames with slash, not backslash in Windows XP
- Closed