diff --git a/src/corelib/io/qtemporaryfile.cpp b/src/corelib/io/qtemporaryfile.cpp index a98256c1f42..ff6a514fc9c 100644 --- a/src/corelib/io/qtemporaryfile.cpp +++ b/src/corelib/io/qtemporaryfile.cpp @@ -70,9 +70,8 @@ QTemporaryFileName::QTemporaryFileName(const QString &templateName) qfilename.append(".XXXXXX"_L1); // "Nativify" :-) - QFileSystemEntry::NativePath filename = QFileSystemEngine::absoluteName( - QFileSystemEntry(qfilename, QFileSystemEntry::FromInternalPath())) - .nativeFilePath(); + QFileSystemEntry::NativePath filename = + QFileSystemEntry(QDir::cleanPath(qfilename)).nativeFilePath(); // Find mask in native path phPos = filename.size(); diff --git a/tests/auto/corelib/plugin/qpluginloader/tst_qpluginloader.cpp b/tests/auto/corelib/plugin/qpluginloader/tst_qpluginloader.cpp index bb6ecb45f41..cc8ed2db6ea 100644 --- a/tests/auto/corelib/plugin/qpluginloader/tst_qpluginloader.cpp +++ b/tests/auto/corelib/plugin/qpluginloader/tst_qpluginloader.cpp @@ -16,6 +16,8 @@ # include #endif +using namespace Qt::StringLiterals; + // Helper macros to let us know if some suffixes are valid #define bundle_VALID false #define dylib_VALID false @@ -128,7 +130,7 @@ static std::unique_ptr patchElf(const QString &source, ElfPatche const char *basename = QTest::currentDataTag(); if (!basename) basename = QTest::currentTestFunction(); - tmplib.reset(new QTemporaryFile(basename + QString(".XXXXXX" SUFFIX))); + tmplib.reset(new QTemporaryFile(QDir::currentPath() + u'/' + basename + u".XXXXXX" SUFFIX ""_s)); QVERIFY2(tmplib->open(), qPrintable(tmplib->errorString())); // sanity-check