diff options
-rw-r--r-- | src/corelib/io/qfile.h | 7 |
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 |