diff options
| author | Sami Shalayel <sami.shalayel@qt.io> | 2022-10-05 18:25:11 +0200 |
|---|---|---|
| committer | Sami Shalayel <sami.shalayel@qt.io> | 2022-10-14 09:36:56 +0200 |
| commit | c52b7fdca8e5a6fd4a14e22d47f53d301af5c316 (patch) | |
| tree | 7c2a7f0d62ecf1a86418938e7153ea6cd0397ee0 /src/qml/compiler/qqmlirbuilder.cpp | |
| parent | 18333db9af01b5e3ffc65e1e194e47b337112987 (diff) | |
qmlcompiler: refactor ContextualTypes to know its context
The code in qmlcompiler working on ContextualTypes is very confusing
as it handles internal types (c++ and synthetic jsrootgen type names)
and qml types at the same places.
Furthermore, some methods like qqmljsscope::findType() have different
behaviors when running in different contexts, e.g. in the internal
type context it needs to lookup namespaced c++ enums (e.g.
QQmlComponent::Status) while in the qml type context it needs to
lookup inline components (qmlFileName.MyInlineComponent).
Changed ContextualTypes to be a struct with the types QHash and
an enum with the context (QML or INTERNAL),
Drive-by change: amend the iterations over types.keys() to use an iterator
instead of allocating a temporary QList as types is not that small
(may contain around 400 items just for the builtins).
Fixes: QTBUG-107191
Change-Id: Ib463ec873019ea1e6844c522a090030e9a44d53f
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/compiler/qqmlirbuilder.cpp')
0 files changed, 0 insertions, 0 deletions
