diff options
Diffstat (limited to 'src/tools/moc')
-rw-r--r-- | src/tools/moc/moc.cpp | 6 | ||||
-rw-r--r-- | src/tools/moc/moc.h | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/src/tools/moc/moc.cpp b/src/tools/moc/moc.cpp index 9cfd877d945..64af8c10fc1 100644 --- a/src/tools/moc/moc.cpp +++ b/src/tools/moc/moc.cpp @@ -68,6 +68,8 @@ bool Moc::parseClassHead(ClassDef *def) const QByteArrayView lex = lexemView(); if (lex != "final" && lex != "sealed" && lex != "Q_DECL_FINAL") name = lexem(); + else + def->isFinal = true; } def->qualified += name; @@ -85,6 +87,8 @@ bool Moc::parseClassHead(ClassDef *def) const QByteArrayView lex = lexemView(); if (lex != "final" && lex != "sealed" && lex != "Q_DECL_FINAL") return false; + else + def->isFinal = true; } if (test(COLON)) { @@ -2055,6 +2059,8 @@ QJsonObject ClassDef::toJson() const cls["className"_L1] = QString::fromUtf8(classname.constData()); cls["qualifiedClassName"_L1] = QString::fromUtf8(qualified.constData()); cls["lineNumber"_L1] = lineNumber; + if (isFinal) + cls["final"_L1] = true; QJsonArray classInfos; for (const auto &info: std::as_const(classInfoList)) { diff --git a/src/tools/moc/moc.h b/src/tools/moc/moc.h index bf55aa7c44f..aafa80d2164 100644 --- a/src/tools/moc/moc.h +++ b/src/tools/moc/moc.h @@ -207,6 +207,7 @@ struct ClassDef : BaseDef { bool hasQGadget = false; bool hasQNamespace = false; bool requireCompleteMethodTypes = false; + bool isFinal = false; QJsonObject toJson() const; }; |