aboutsummaryrefslogtreecommitdiffstats
path: root/src/qmlcompiler/qqmljsimportvisitor.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2020-11-12 10:00:41 +0100
committerUlf Hermann <ulf.hermann@qt.io>2020-11-12 11:55:49 +0100
commitc6452857a96d24325906ebd5529cfdda916a68fc (patch)
tree46486b757347707029ed6a53cf362f3a13ca8cb7 /src/qmlcompiler/qqmljsimportvisitor.cpp
parentf8f0eff273ba832f8b8ae8b27d4d3cf7a2d2efb7 (diff)
QmlCompiler: Store values QQmlJSMetaEnum when available
When parsing QML files, we need to keep the enum values around as this is the only place where we can find them (without parsing the same file again, that is). With C++ types we don't strictly need them as they are also available from the C++ header, but if the qmltypes file is nice enough to provide them, we can use them. (Which will be for types that are not actually C++ types, but rather types produced by registering a QML file with qmlRegisterType()). Change-Id: Ibcc93b30e523a00e1eeb80029943c48b83d0e1b5 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qmlcompiler/qqmljsimportvisitor.cpp')
-rw-r--r--src/qmlcompiler/qqmljsimportvisitor.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/qmlcompiler/qqmljsimportvisitor.cpp b/src/qmlcompiler/qqmljsimportvisitor.cpp
index b81f7b59a7..41e8b4da88 100644
--- a/src/qmlcompiler/qqmljsimportvisitor.cpp
+++ b/src/qmlcompiler/qqmljsimportvisitor.cpp
@@ -281,8 +281,10 @@ void QQmlJSImportVisitor::endVisit(UiScriptBinding *scriptBinding)
bool QQmlJSImportVisitor::visit(QQmlJS::AST::UiEnumDeclaration *uied)
{
QQmlJSMetaEnum qmlEnum(uied->name.toString());
- for (const auto *member = uied->members; member; member = member->next)
+ for (const auto *member = uied->members; member; member = member->next) {
qmlEnum.addKey(member->member.toString());
+ qmlEnum.addValue(int(member->value));
+ }
m_currentScope->addEnumeration(qmlEnum);
return true;
}