summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTopi Reinio <topi.reinio@digia.com>2013-05-28 13:47:32 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-05-30 12:49:42 +0200
commit389b6f51613a2d34b132b3955e8595bc594a336a (patch)
treeea0b493c7d8d372c4d61415ff89705b3d501e31f /src
parentc3bec846ac89bb79fbdfa5e2bedb3495b0055b09 (diff)
qdoc: Handle collision nodes when building index files
Currently qdoc skips collision nodes (and their children) when reading index files. This means that cross-linking between modules does not work for nodes that are defined under a collision page node. Most notably, the QML global object 'Qt' cannot be linked to from outside Qml module as it collides with Qt namespace. This change fixes the issue by skipping collision nodes and only processing their children when writing index files. In addition, we need to adjust the function that searches for nodes to the possibility that there may be multiple nodes with the same name but different type. Task-number: QTBUG-31096 Change-Id: Ic71d714f85539d8537021c73d8f1a527006a6f23 Reviewed-by: Martin Smith <martin.smith@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/tools/qdoc/node.cpp9
-rw-r--r--src/tools/qdoc/qdocindexfiles.cpp7
2 files changed, 12 insertions, 4 deletions
diff --git a/src/tools/qdoc/node.cpp b/src/tools/qdoc/node.cpp
index e627cf859e..2184e302ae 100644
--- a/src/tools/qdoc/node.cpp
+++ b/src/tools/qdoc/node.cpp
@@ -862,9 +862,12 @@ Node* InnerNode::findChildNodeByNameAndType(const QString& name, Type type)
if (type == Function)
return primaryFunctionMap.value(name);
else {
- Node *node = childMap.value(name);
- if (node && node->type() == type)
- return node;
+ QList<Node*> nodes = childMap.values(name);
+ for (int i=0; i<nodes.size(); ++i) {
+ Node* node = nodes.at(i);
+ if (node->type() == type)
+ return node;
+ }
}
return 0;
}
diff --git a/src/tools/qdoc/qdocindexfiles.cpp b/src/tools/qdoc/qdocindexfiles.cpp
index daba2cc78a..5f2ebdfd07 100644
--- a/src/tools/qdoc/qdocindexfiles.cpp
+++ b/src/tools/qdoc/qdocindexfiles.cpp
@@ -1183,8 +1183,13 @@ void QDocIndexFiles::generateIndexSections(QXmlStreamWriter& writer,
It is just a place holder for a collection of QML property
nodes. Recurse to its children, which are the QML property
nodes.
+
+ Do the same thing for collision nodes - we want children
+ of collision nodes in the index, but leaving out the
+ parent collision page will make searching for nodes easier.
*/
- if (child->subType() == Node::QmlPropertyGroup) {
+ if (child->subType() == Node::QmlPropertyGroup ||
+ child->subType() == Node::Collision) {
const InnerNode* pgn = static_cast<const InnerNode*>(child);
foreach (Node* c, pgn->childNodes()) {
generateIndexSections(writer, c, generateInternalNodes);