QFile: for filesystem::path, use iterators
Change-Id: I06477d48191e5c02ebf362ee31d8db5b1f76247a Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This commit is contained in:
parent
8c8b9a4173
commit
bf4f6fa230
@ -68,11 +68,8 @@ inline QString fromFilesystemPath(const std::filesystem::path &path)
|
|||||||
|
|
||||||
inline std::filesystem::path toFilesystemPath(const QString &path)
|
inline std::filesystem::path toFilesystemPath(const QString &path)
|
||||||
{
|
{
|
||||||
#ifdef Q_OS_WIN
|
return std::filesystem::path(reinterpret_cast<const char16_t *>(path.cbegin()),
|
||||||
return std::filesystem::path(path.toStdU16String());
|
reinterpret_cast<const char16_t *>(path.cend()));
|
||||||
#else
|
|
||||||
return std::filesystem::path(path.toStdString());
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Both std::filesystem::path and QString (without QT_NO_CAST_FROM_ASCII) can be implicitly
|
// Both std::filesystem::path and QString (without QT_NO_CAST_FROM_ASCII) can be implicitly
|
||||||
|
Loading…
x
Reference in New Issue
Block a user