qt5, qt6: fix QML path search order

QQmlImportDatabase::addImportPath _prepends_ to the search path,
so our version specific search paths need to be added in last.
This commit is contained in:
K900 2024-01-19 12:52:59 +03:00
parent 631f14c407
commit e44cf032bc
2 changed files with 7 additions and 7 deletions

View File

@ -1,5 +1,5 @@
diff --git a/src/qml/qml/qqmlimport.cpp b/src/qml/qml/qqmlimport.cpp
index 289f11d006..80c422403c 100644
index 289f11d006..9b0a48c6c7 100644
--- a/src/qml/qml/qqmlimport.cpp
+++ b/src/qml/qml/qqmlimport.cpp
@@ -1897,17 +1897,22 @@ QQmlImportDatabase::QQmlImportDatabase(QQmlEngine *e)
@ -26,8 +26,8 @@ index 289f11d006..80c422403c 100644
+ }
+ };
+
+ addEnvImportPath("NIXPKGS_QT5_QML_IMPORT_PATH");
+ addEnvImportPath("QML2_IMPORT_PATH");
+ addEnvImportPath("NIXPKGS_QT5_QML_IMPORT_PATH");
addImportPath(QStringLiteral("qrc:/qt-project.org/imports"));
addImportPath(QCoreApplication::applicationDirPath());

View File

@ -1,12 +1,12 @@
diff --git a/src/qml/qml/qqmlimport.cpp b/src/qml/qml/qqmlimport.cpp
index a7d1a3f77f..aac7392d4f 100644
index 2e482c220d..4873809bec 100644
--- a/src/qml/qml/qqmlimport.cpp
+++ b/src/qml/qml/qqmlimport.cpp
@@ -1515,6 +1515,7 @@ QQmlImportDatabase::QQmlImportDatabase(QQmlEngine *e)
};
@@ -1517,6 +1517,7 @@ QQmlImportDatabase::QQmlImportDatabase(QQmlEngine *e)
// env import paths
+ addEnvImportPath("NIXPKGS_QT6_QML_IMPORT_PATH");
addEnvImportPath("QML_IMPORT_PATH");
addEnvImportPath("QML2_IMPORT_PATH");
+ addEnvImportPath("NIXPKGS_QT6_QML_IMPORT_PATH");
addImportPath(QStringLiteral("qrc:/qt/qml"));
addImportPath(QStringLiteral("qrc:/qt-project.org/imports"));