diff options
author | Mårten Nordheim <marten.nordheim@qt.io> | 2020-09-16 14:33:41 +0200 |
---|---|---|
committer | Mårten Nordheim <marten.nordheim@qt.io> | 2020-09-16 19:03:01 +0200 |
commit | bf4f6fa230e0fad691dfcad603ed9a9a8309d3f8 (patch) | |
tree | 1b95b9a6c697012791d9403c3ad8c9e5e76934e5 /src/corelib/io | |
parent | 8c8b9a4173f4add522ec13de85107deba7c82da0 (diff) |
QFile: for filesystem::path, use iterators
Change-Id: I06477d48191e5c02ebf362ee31d8db5b1f76247a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/corelib/io')
-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 |