diff options
| author | Ulf Hermann <ulf.hermann@qt.io> | 2025-04-08 15:34:55 +0200 |
|---|---|---|
| committer | Ulf Hermann <ulf.hermann@qt.io> | 2025-04-15 19:27:08 +0200 |
| commit | 7d405c4e33d7d559cef3a22ee514e357732cd1b3 (patch) | |
| tree | a679be4057cca89b372925cc066112ef9f9d8694 /tests/auto/qml/qqmlmoduleplugin/nestedPlugin/nestedPlugin.cpp | |
| parent | 6a8478829747289cdcce2a6e9628b31cfd865f15 (diff) | |
QtQml: Load pre-registered types if no remote qmldir can be found
If we have a potentially remote qmldir we have to wait for it to surface
before we load any pre-registered types. The qmldir might contain
dependent imports. Once we've exhausted all possible remote qmldir URLs,
we can load any pre-registered types. We have to unconditionally insert
the import instance at the right place in the import namespace, though.
Otherwise the imported types will get re-ordered.
There are some pre-existing quirks to this behavior: We only trigger the
code that postpones the loading if the QML engine has URL interceptors.
Otherwise we load the pre-registered types right away. Changing this to
do the right thing and first check the remote locations for any
potential qmldirs would be a subtle change in behavior with large
potential to break someone's code. We should not do it without a proper
migration path.
As a drive-by, fix the generation of warnings for unresolved imports. We
only want to warn about actually unresolved imports. Previously, it
warned about all imports it had to postpone if any of them was
unresolved.
Amends commit 46429839fedd79244559069bb4235a8b0e7ebf0a
Pick-to: 6.9 6.8 6.5
Fixes: QTBUG-135334
Change-Id: Ib86ea58c19d96d2162f6735ce1caf88c562b65e7
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tests/auto/qml/qqmlmoduleplugin/nestedPlugin/nestedPlugin.cpp')
| -rw-r--r-- | tests/auto/qml/qqmlmoduleplugin/nestedPlugin/nestedPlugin.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlmoduleplugin/nestedPlugin/nestedPlugin.cpp b/tests/auto/qml/qqmlmoduleplugin/nestedPlugin/nestedPlugin.cpp index 9bddf0f0c4..ed03894fe3 100644 --- a/tests/auto/qml/qqmlmoduleplugin/nestedPlugin/nestedPlugin.cpp +++ b/tests/auto/qml/qqmlmoduleplugin/nestedPlugin/nestedPlugin.cpp @@ -33,11 +33,13 @@ public: { Q_ASSERT(QLatin1String(uri) == "org.qtproject.AutoTestQmlNestedPluginType"); qmlRegisterType<MyPluginTypeNested>(uri, 1, 0, "MyPluginType"); + qmlRegisterType<MyPluginTypeNested>(uri, 1, 0, "Conflict"); QString nestedUri(uri); nestedUri += QLatin1String(".Nested"); qmlRegisterType<MyNestedPluginType>(nestedUri.toLatin1().constData(), 1, 0, "MyNestedPluginType"); + qmlRegisterType<MyNestedPluginType>(nestedUri.toLatin1().constData(), 1, 0, "Conflict"); } }; |
