QmlCompiler: Remember through which imports documents see types
At run time, a type is found by name through an import of its module.
Different versions of a module can provide different types under
the same name. In order to find a type again the same way, we need to
know the exact import through which a document sees it. That includes
the imports of modules forwarded by qmldir "import" lines.
Track the module imports each import statement results in. When a
document imports a module or a directory, record for each type
it can see the module, the version of the import, and the name the
import provides the type under. Directory imports are recorded with an
invalid version, like the QML engine does.
Pick-to: 6.12
Task-number: QTBUG-150967
Change-Id: I5eb30eadb88a89281929288124fda75656ff6110
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>