summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qfile.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/io/qfile.h')
-rw-r--r--src/corelib/io/qfile.h7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/corelib/io/qfile.h b/src/corelib/io/qfile.h
index 882adca715..057e9e12e8 100644
--- a/src/corelib/io/qfile.h
+++ b/src/corelib/io/qfile.h
@@ -68,11 +68,8 @@ inline QString fromFilesystemPath(const std::filesystem::path &path)
inline std::filesystem::path toFilesystemPath(const QString &path)
{
-#ifdef Q_OS_WIN
- return std::filesystem::path(path.toStdU16String());
-#else
- return std::filesystem::path(path.toStdString());
-#endif
+ return std::filesystem::path(reinterpret_cast<const char16_t *>(path.cbegin()),
+ reinterpret_cast<const char16_t *>(path.cend()));
}
// Both std::filesystem::path and QString (without QT_NO_CAST_FROM_ASCII) can be implicitly