diff options
author | Martin Smith <martin.smith@digia.com> | 2014-05-23 13:26:36 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-06-01 13:40:53 +0200 |
commit | 46959875cf7ddeb9bbcee883e4bfaef63992b870 (patch) | |
tree | 727c786536dbd21b28eaa8fcaf429259c97f6dc1 /src/tools/qdoc/codemarker.cpp | |
parent | bb794270ec6cffb5f95bd7d18056b9e7bede7baa (diff) |
qdoc: Give documenter more control of linking
This update is preparation for implementing the actual task
described in the bug. To implement it required converting
the QML type node and the QML basic type node to be first
order tree nodes instead of subtypes of the documentation
node. This cleans up a lot of messy logic in some places.
It was also necessary to split the getLink() function in the
html output generator into two functions, one still called
getLink(), which handles the \l command, and one called
qetAutoLink() which is called for generating auto links.
This should make qdoc run faster.
The basic infrastructure was also added for parsing the
string in the square brackets for the \l command.
There will be a further update to complete this task.
Note that some autolinks might not be generated due to
this change. I haven't seen any yet, but I believe there
will be some. This can be fixed later, if it is a problem.
Task-number: QTBUG-39221
Change-Id: I8135229984398408205ba901b9ef95ceac74683c
Reviewed-by: Topi Reiniƶ <topi.reinio@digia.com>
Diffstat (limited to 'src/tools/qdoc/codemarker.cpp')
-rw-r--r-- | src/tools/qdoc/codemarker.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/tools/qdoc/codemarker.cpp b/src/tools/qdoc/codemarker.cpp index ec342c6df0..235b3c3f04 100644 --- a/src/tools/qdoc/codemarker.cpp +++ b/src/tools/qdoc/codemarker.cpp @@ -273,7 +273,7 @@ QString CodeMarker::taggedNode(const Node* node) case Node::Property: tag = QLatin1String("@property"); break; - case Node::Document: + case Node::QmlType: /* Remove the "QML:" prefix, if present. There shouldn't be any of these "QML:" @@ -282,10 +282,11 @@ QString CodeMarker::taggedNode(const Node* node) qualifiers, but this code is kept to be backward compatible. */ - if (node->subType() == Node::QmlClass) { - if (node->name().startsWith(QLatin1String("QML:"))) - name = name.mid(4); - } + if (node->name().startsWith(QLatin1String("QML:"))) + name = name.mid(4); + tag = QLatin1String("@property"); + break; + case Node::Document: tag = QLatin1String("@property"); break; case Node::QmlMethod: @@ -400,9 +401,8 @@ void CodeMarker::insert(FastSection &fastSection, InnerNode* p = node->parent(); if (p->type() == Node::QmlPropertyGroup) p = p->parent(); - if (p != fastSection.parent_) { // && !node->parent()->isAbstract()) { - if (p->subType() != Node::QmlClass || !p->isAbstract()) { - //if (node->type() != Node::QmlProperty) { + if (p != fastSection.parent_) { + if (!p->isQmlType() || !p->isAbstract()) { inheritedMember = true; } } @@ -622,6 +622,7 @@ QStringList CodeMarker::macRefsForNode(Node *node) } case Node::Namespace: case Node::Document: + case Node::QmlType: default: return QStringList(); } |