QtQml: Allow type lookups to be rebased onto new scope objects
The types present at a specific source location in a compilation unit
that's bound to an engine can't change. We never need to re-do a cached
type lookup. What may change is the scope object we're dealing with, but
that is only one member of QQmlTypeWrapper. We can simply create a new
QQmlTypeWrapper with that one member changed where the need arises.
Pick-to: 6.12
Fixes: QTBUG-151376
Change-Id: I7c73dcc5dd196a4011a11510cafd3b5144a5a44a
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>