summaryrefslogtreecommitdiff
path: root/src/qdoc/clangcodeparser.cpp
diff options
context:
space:
mode:
authorMartin Smith <martin.smith@qt.io>2017-05-08 10:48:15 +0200
committerMartin Smith <martin.smith@qt.io>2017-08-10 07:35:38 +0000
commitfd3976142ca2ec4fb555917cad92135a2070eb0b (patch)
tree9b19ca7caa966ff69aa45ab42ca410b5af2b7af5 /src/qdoc/clangcodeparser.cpp
parentda183316a39979f42070759eecb9062fcf240ac5 (diff)
downloadqttools-fd3976142ca2ec4fb555917cad92135a2070eb0b.tar.gz
qdoc: Better support for multi-\fn documentation blocks
This change is a partial fix for the multi-\fn documentation concept. It outputs the documentation once but listing all the function signatures from the \fn commands found in the qdoc comment. Multiple \since commands are not implemented; the \until command is not implemented, and providing text applicable to a specific \fn signature is not implemented. This change requires clang, which means it requires a sequence of other updates as well, so you can't test it unless you have all that stuff. Task-number: QTBUG-60420 Change-Id: Ib316b6f97fa427ef730c4badfc785101bff55dce Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io>
Diffstat (limited to 'src/qdoc/clangcodeparser.cpp')
-rw-r--r--src/qdoc/clangcodeparser.cpp25
1 files changed, 21 insertions, 4 deletions
diff --git a/src/qdoc/clangcodeparser.cpp b/src/qdoc/clangcodeparser.cpp
index 18727ebde..3ef696367 100644
--- a/src/qdoc/clangcodeparser.cpp
+++ b/src/qdoc/clangcodeparser.cpp
@@ -1207,12 +1207,29 @@ void ClangCodeParser::parseSourceFile(const Location& /*location*/, const QStrin
doc.location().warning(tr("Multiple topic commands found in comment: %1").arg(topicList));
}
ArgList::ConstIterator a = args.constBegin();
+ Node *node = 0;
+ SharedCommentNode* scn = 0;
+ int count = args.size();
while (a != args.constEnd()) {
Doc nodeDoc = doc;
- Node *node = processTopicCommand(nodeDoc, topic, *a);
- if (node != 0) {
- nodes.append(node);
- docs.append(nodeDoc);
+ if ((count > 1) && (topic == COMMAND_FN)) {
+ node = processFnCommand(*a, doc);
+ if (node != 0) {
+ if (scn == 0) {
+ scn = new SharedCommentNode(node->parent(), count);
+ nodes.append(scn);
+ docs.append(nodeDoc);
+ }
+ scn->append(node);
+ node->setCollectiveNode(scn);
+ }
+ }
+ else {
+ node = processTopicCommand(nodeDoc, topic, *a);
+ if (node != 0) {
+ nodes.append(node);
+ docs.append(nodeDoc);
+ }
}
++a;
}