diff options
author | Topi Reinio <topi.reinio@qt.io> | 2018-11-15 00:13:58 +0100 |
---|---|---|
committer | Topi Reiniƶ <topi.reinio@qt.io> | 2018-11-15 23:01:47 +0000 |
commit | 5a678ec9a8ae5159456e4af7b81968e4ea027d6b (patch) | |
tree | 7dcacccb5202e938eb82f9c8b3ebedc3e0750e8b /src/qdoc/node.cpp | |
parent | bcc2ba45d316c01b0ce4827092bd8b2c28f3f2c3 (diff) | |
download | qttools-5a678ec9a8ae5159456e4af7b81968e4ea027d6b.tar.gz |
qdoc: Fix link resolution for types under namespaces
When QDoc tries to resolve a link to a type from a function parameter,
it sets a 'TypesOnly' find flag. For types that contain a scope
resolution operator(s), i.e. double-colons, QDoc first looks for the
scope (namespace), and then the type under that scope.
The problem was that the TypesOnly flag was passed to also the
function call to find the namespace. This failed as namespaces are
not types.
Another problematic corner case happened with name clashes between
a C++ module and a namespace, as is the case with e.g. 'Qt3DCore'.
Here, QDoc tried to resolve the module node as the scope, and
subsequently failed to find anything under that scope as module nodes
have no children.
Task-number: QTBUG-69484
Change-Id: Ia3c8fa96263a24176a11cf23a3469a374de7973a
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Martin Smith <martin.smith@qt.io>
Diffstat (limited to 'src/qdoc/node.cpp')
-rw-r--r-- | src/qdoc/node.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/qdoc/node.cpp b/src/qdoc/node.cpp index e23b10d57..6893b6367 100644 --- a/src/qdoc/node.cpp +++ b/src/qdoc/node.cpp @@ -841,7 +841,7 @@ Node *Aggregate::findChildNode(const QString& name, Node::Genus genus, int findF } else { NodeList nodes = childMap_.values(name); if (!nodes.isEmpty()) { - for (int i=0; i<nodes.size(); ++i) { + for (int i = 0; i < nodes.size(); ++i) { Node* node = nodes.at(i); if (genus == node->genus()) { if (findFlags & TypesOnly) { @@ -853,7 +853,8 @@ Node *Aggregate::findChildNode(const QString& name, Node::Genus genus, int findF && !node->isJsBasicType() && !node->isEnumType()) continue; - } + } else if (findFlags & IgnoreModules && node->isModule()) + continue; return node; } } |