nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at python-updates 33 lines 1.4 kB view raw
1diff --git a/src/qml/qml/qqmlimport.cpp b/src/qml/qml/qqmlimport.cpp 2index 289f11d006..9b0a48c6c7 100644 3--- a/src/qml/qml/qqmlimport.cpp 4+++ b/src/qml/qml/qqmlimport.cpp 5@@ -1897,17 +1897,22 @@ QQmlImportDatabase::QQmlImportDatabase(QQmlEngine *e) 6 addImportPath(installImportsPath); 7 8 // env import paths 9- if (Q_UNLIKELY(!qEnvironmentVariableIsEmpty("QML2_IMPORT_PATH"))) { 10- const QString envImportPath = qEnvironmentVariable("QML2_IMPORT_PATH"); 11+ auto addEnvImportPath = [this](const char *var) { 12 #if defined(Q_OS_WIN) 13 QLatin1Char pathSep(';'); 14 #else 15 QLatin1Char pathSep(':'); 16 #endif 17- QStringList paths = envImportPath.split(pathSep, Qt::SkipEmptyParts); 18- for (int ii = paths.count() - 1; ii >= 0; --ii) 19- addImportPath(paths.at(ii)); 20- } 21+ if (Q_UNLIKELY(!qEnvironmentVariableIsEmpty(var))) { 22+ const QString envImportPath = qEnvironmentVariable(var); 23+ QStringList paths = envImportPath.split(pathSep, Qt::SkipEmptyParts); 24+ for (int ii = paths.count() - 1; ii >= 0; --ii) 25+ addImportPath(paths.at(ii)); 26+ } 27+ }; 28+ 29+ addEnvImportPath("QML2_IMPORT_PATH"); 30+ addEnvImportPath("NIXPKGS_QT5_QML_IMPORT_PATH"); 31 32 addImportPath(QStringLiteral("qrc:/qt-project.org/imports")); 33 addImportPath(QCoreApplication::applicationDirPath());