summaryrefslogtreecommitdiffstats
path: root/src/tools/qdoc/tree.h
diff options
context:
space:
mode:
authorTopi Reinio <topi.reinio@digia.com>2015-07-30 12:51:22 +0200
committerTopi Reiniƶ <topi.reinio@digia.com>2015-08-03 12:37:57 +0000
commit7b77ef6b0a28886296e8a551339eb2874470bfc2 (patch)
treeaa3198a7a442f9f6ca34ac0e615ec15f3c8c459c /src/tools/qdoc/tree.h
parent789c9954c788b6129b3b406db4d68b5bb52386b8 (diff)
qdoc: Make \target and \keyword commands link as expected
When resolving targets added for each node, QDoc didn't run the check recursively; this meant that \target and \keyword commands did not link when used in documentation nodes that are not direct children of the root node. There include e.g. documentation for functions and QML properties/methods. This commit fixes that issue, and also modifies the behavior of \keyword slightly: Using a \keyword no longer generates a HTML anchor reference. Instead, linking to a keyword links directly to the parent item which defines the \keyword. This produces cleaner HTML by omitting unnecessary anchors. Change-Id: I87659642770a5372409ecb09cb576fbad295155e Task-number: QTBUG-47286 Reviewed-by: Martin Smith <martin.smith@digia.com>
Diffstat (limited to 'src/tools/qdoc/tree.h')
-rw-r--r--src/tools/qdoc/tree.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/tools/qdoc/tree.h b/src/tools/qdoc/tree.h
index 0f41c221b6..9e195c90ae 100644
--- a/src/tools/qdoc/tree.h
+++ b/src/tools/qdoc/tree.h
@@ -56,7 +56,12 @@ struct TargetRec
TargetRec::TargetType type,
Node* node,
int priority)
- : node_(node), ref_(name), title_(title), priority_(priority), type_(type) { }
+ : node_(node), ref_(name), title_(title), priority_(priority), type_(type) {
+ // Discard the dedicated ref for keywords - they always
+ // link to the top of the QDoc comment they appear in
+ if (type == Keyword)
+ ref_.clear();
+ }
bool isEmpty() const { return ref_.isEmpty(); }