diff options
author | Martin Smith <martin.smith@digia.com> | 2015-02-26 10:34:47 +0100 |
---|---|---|
committer | Martin Smith <martin.smith@digia.com> | 2015-02-26 13:24:13 +0000 |
commit | 99120ca3cf2a22f89fd7ec46ff483882fc3a2bbe (patch) | |
tree | b3f91f86565049a4de6490481cb41edef0d55864 /src/tools/qdoc/tree.cpp | |
parent | cd46d94906ec0d10acd0fcb086d9177a1b282691 (diff) |
qdoc: Correct parsing of the using clause
qdoc could only parse the using clause where the 'using'
keyword was followed by 'namespace'. Now it can parse
using clauses with or without 'namespace'.
Change-Id: Ic4aad025c00b3bda2bc1cbd52d0ba8dbbad653e5
Task-number: QTBUG-44553
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Reviewed-by: Topi Reiniƶ <topi.reinio@digia.com>
Diffstat (limited to 'src/tools/qdoc/tree.cpp')
-rw-r--r-- | src/tools/qdoc/tree.cpp | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/src/tools/qdoc/tree.cpp b/src/tools/qdoc/tree.cpp index ed4b4e3979..6393ad4e6f 100644 --- a/src/tools/qdoc/tree.cpp +++ b/src/tools/qdoc/tree.cpp @@ -499,6 +499,29 @@ void Tree::resolveCppToQmlLinks() } /*! + For each C++ class node, resolve any \c using clauses + that appeared in the class declaration. + */ +void Tree::resolveUsingClauses() +{ + foreach (Node* child, root_.childNodes()) { + if (child->isClass()) { + ClassNode* cn = static_cast<ClassNode*>(child); + QList<UsingClause>& usingClauses = cn->usingClauses(); + QList<UsingClause>::iterator uc = usingClauses.begin(); + while (uc != usingClauses.end()) { + if (!(*uc).node()) { + const Node* n = qdb_->findFunctionNode((*uc).signature(), cn, Node::CPP); + if (n) + (*uc).setNode(n); + } + ++uc; + } + } + } +} + +/*! */ void Tree::fixInheritance(NamespaceNode* rootNode) { @@ -1427,7 +1450,8 @@ void Tree::insertQmlType(const QString& key, QmlTypeNode* n) const Node* Tree::findFunctionNode(const QString& target, const Node* relative, Node::Genus genus) { QString t = target; - t.chop(2); + if (t.endsWith("()")) + t.chop(2); QStringList path = t.split("::"); const FunctionNode* fn = findFunctionNode(path, relative, SearchBaseClasses, genus); if (fn && fn->metaness() != FunctionNode::MacroWithoutParams) |