diff --git a/src/tools/windeployqt/main.cpp b/src/tools/windeployqt/main.cpp index 556a6341aa..6b788cf41f 100644 --- a/src/tools/windeployqt/main.cpp +++ b/src/tools/windeployqt/main.cpp @@ -1626,8 +1626,8 @@ int main(int argc, char **argv) const QByteArray qtBinPath = QFile::encodeName(QDir::toNativeSeparators(QCoreApplication::applicationDirPath())); QByteArray path = qgetenv("PATH"); if (!path.contains(qtBinPath)) { // QTBUG-39177, ensure Qt is in the path so that qt.conf is taken into account. - path += QDir::listSeparator().toLatin1(); - path += qtBinPath; + path.prepend(QDir::listSeparator().toLatin1()); + path.prepend(qtBinPath); qputenv("PATH", path); }