diff options
Diffstat (limited to 'typesystem.cpp')
-rw-r--r-- | typesystem.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/typesystem.cpp b/typesystem.cpp index a3543750b..896374a8b 100644 --- a/typesystem.cpp +++ b/typesystem.cpp @@ -422,7 +422,7 @@ bool Handler::startElement(const QString &, const QString &n, attributes["type"] = QString(); break; case StackElement::EnumTypeEntry: - attributes["flags"] = "no"; + attributes["flags"] = QString(); attributes["upper-bound"] = QString(); attributes["lower-bound"] = QString(); attributes["force-integer"] = "no"; @@ -591,10 +591,19 @@ bool Handler::startElement(const QString &, const QString &n, m_currentEnum->setExtensible(convertBoolean(attributes["extensible"], "extensible", false)); // put in the flags parallel... - if (!attributes["flags"].isEmpty() && attributes["flags"].toLower() != "no") { + QString flagName = attributes["flags"]; + if (!flagName.isEmpty()) { FlagsTypeEntry *ftype = new FlagsTypeEntry("QFlags<" + name + ">", since); ftype->setOriginator(m_currentEnum); - ftype->setOriginalName(attributes["flags"]); + // Try to get the guess the qualified flag name + if (!flagName.contains("::") && names.count() > 1) { + QStringList cpy(names); + cpy.removeLast(); + cpy.append(flagName); + flagName = cpy.join("::"); + } + + ftype->setOriginalName(flagName); ftype->setCodeGeneration(m_generate); QString n = ftype->originalName(); |