Commit Graph

4 Commits

Author SHA1 Message Date
Ulf Hermann bae18ecd34 QtQml: Key plugins by URI where possible
This allows us to associate different qmldir files for the same module
with one another. Typically there is one qmldir file in the resource
file system and one in the QML import path. We cannot load plugins for
the latter, but usually we have already loaded any plugins we need. Now
we can detect this.

This requires us to construct a proper URI for implicit imports. The
easiest way to do this is to just use the URI from the qmldir if
available.

Modules with versions encoded in their paths and modules with multiple
plugins cannot be resolved by URI only. These continue to be keyed by
path. However, as we do not generate such modules, we will not
automatically get two instances of those, and we won't have to fall back
from one to the other.

Pick-to: 6.2
Change-Id: Ic79add936d263a8e559fd998fca15a6ae160952e
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-06-30 10:08:03 +02:00
Ulf Hermann 88424ba1bf CMake: Add qmldir classname entry only if there is a plugin
A class name without a plugin is pointless.

Pick-to: 6.2
Change-Id: I3cfd95bc7d9dd9e80d7f23fbd6e2c2b2b855763d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-06-24 10:53:18 +02:00
Ulf Hermann c9e901db89 CMake: Copy RESOURCES files to the build directory, too
We need to treat them exactly like QML_FILES.

Pick-to: 6.2
Change-Id: I5582ad933c844c55f9015478672607e6d1218d84
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-06-24 10:53:18 +02:00
Ulf Hermann 5e78dc847d Add basic QML application to test CMake API for QML modules
An application with two modules which allows us to check that all the
files end up in the right places.

Pick-to: 6.2
Change-Id: I58557d453e644e13f2eb646ec3195bba2654f569
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-06-24 10:53:18 +02:00