summaryrefslogtreecommitdiff
path: root/src/qdoc/cppcodeparser.cpp
diff options
context:
space:
mode:
authorMartin Smith <martin.smith@qt.io>2018-02-05 11:45:20 +0100
committerMartin Smith <martin.smith@qt.io>2018-02-05 11:40:36 +0000
commitafe94fcd27ebf63f825002b6c689381ec9792285 (patch)
treebb5e84689b2187dffb3b4b32bcf71fbc2e9caed4 /src/qdoc/cppcodeparser.cpp
parentaf023844d460d5a1530ebb5e4faa80460f69164b (diff)
downloadqttools-afe94fcd27ebf63f825002b6c689381ec9792285.tar.gz
qdoc: Fix regression for wrongly reporting multiple topics
We have the case where multiple different topic commands can appear in a qdoc comment in a .cpp file, when C++ is being documented as QML. Specifically, a \qmlpropertygroup command can be used with multiple \qmlproperty commands. The clang code parser was reporting this as an error, even though clang would never see these commaqndes because they are parsed by the old qdoc command parser. The hasTooManyTopics() function was changed to allow this case. It fixes many qdoc warnings in QtDeclarative. Change-Id: Iaea9a4b9c531f022544749819f65a48111ad0cc1 Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io>
Diffstat (limited to 'src/qdoc/cppcodeparser.cpp')
-rw-r--r--src/qdoc/cppcodeparser.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/qdoc/cppcodeparser.cpp b/src/qdoc/cppcodeparser.cpp
index a7db13a94..14e4fa7ba 100644
--- a/src/qdoc/cppcodeparser.cpp
+++ b/src/qdoc/cppcodeparser.cpp
@@ -1558,6 +1558,13 @@ bool CppCodeParser::hasTooManyTopics(const Doc &doc) const
{
QSet<QString> topicCommandsUsed = topicCommands() & doc.metaCommandsUsed();
if (topicCommandsUsed.count() > 1) {
+ bool ok = true;
+ for (const auto &t : topicCommandsUsed) {
+ if (!t.startsWith(QLatin1String("qml")) && !t.startsWith(QLatin1String("js")))
+ ok = false;
+ }
+ if (ok)
+ return false;
QString topicList;
for (const auto &t : topicCommandsUsed)
topicList += QLatin1String(" \\") + t + QLatin1Char(',');