summaryrefslogtreecommitdiffstats
path: root/src/tools/moc/generator.cpp
diff options
context:
space:
mode:
authorMårten Nordheim <[email protected]>2025-03-24 18:37:14 +0100
committerMårten Nordheim <[email protected]>2025-04-04 03:57:27 +0200
commit2e61a7fc60fd0adaffb413d84d39dc4133d9a47d (patch)
tree763ce617759aa13e2a49fa6d7da6ff4b96479083 /src/tools/moc/generator.cpp
parent4cd66686e4fcf31ca1c8038c11125f90dc0b4782 (diff)
Moc: Propagate flags from aliases (Q_FLAG)
When creating the list of 'enums' to print into the moc file we go through enums that have been defined and then we consult aliases pointing to those names. If an alias is known we also add this to the list. But we don't copy over the flags for the alias so they have the exact same flags as the original enum. In practice this is not a problem, the only flag it carries is 'EnumIsFlag' and we independently deduce this using the fact that it's an alias. It only really reveals itself in moc-output since we cannot differentiate it from enum, so we print them all prefixed with an 'enum' comment. Change-Id: Iad055e69549ec1e854e1b5ac9992b035a4c343b4 Reviewed-by: Fabian Kosmale <[email protected]>
Diffstat (limited to 'src/tools/moc/generator.cpp')
-rw-r--r--src/tools/moc/generator.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/tools/moc/generator.cpp b/src/tools/moc/generator.cpp
index 6d43a5d9eb3..78cd6451cb5 100644
--- a/src/tools/moc/generator.cpp
+++ b/src/tools/moc/generator.cpp
@@ -233,6 +233,7 @@ void Generator::generateCode()
QByteArray alias = cdef->flagAliases.value(def.name);
if (cdef->enumDeclarations.contains(alias)) {
def.name = alias;
+ def.flags |= cdef->enumDeclarations[alias];
enumList += def;
}
}