Details
-
Epic
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
None
-
None
-
QFilePath
-
Foundation PM Prioritized
Description
Everywhere in Qt, we use QString for file names. This has several disadvantages:
- you cannot overload functions for string and file(name)
- if we want to support std::filesystem::path, we need to overload all function that take QString-as-file-name
- for a particularly horrible peek at how this might look, see Qt 6's QFileInfo API
- simple file-name manipulations like basename or dirname require use of the rather expensive QFileInfo
- Everything always has to go through UTF-16, even on platforms, such as Unix, which do not ascribe meaning to the octets that make up file names, with very few exceptions.
- Case-sensitivity has to be thought of manually
Enter QFilePath, which could solve all of the above:
- overload QString and QFilePath, naturally
- (eventually) have one QFilePath overload that accepts both QString-as-a-file-name, as well as {{std::filesystem::path}}s
- simple textual conversions can be as cheap as QString modifications
- underlying storage could be the platform's native encoding instead of UTF-16 everywhere
- operator== could have default case-sensitivity built-in
This could be an inline wrapper around std::filesystem::path, if we can depend on its presence on all platforms.
Attachments
Issue Links
- relates to
-
QTBUG-28246 QFileSystemEngine::isCaseSensitive() is hardcoded to return false on Windows and true on Unix
- Open
-
QTBUG-59402 Applications using Qt cannot handle real files on disk with certain filenames
- Closed