path: root/src
diff options
authorTopi Reinio <>2015-03-16 12:55:09 +0100
committerMartin Smith <>2015-03-16 12:50:09 +0000
commit642b80e9e9a4e6068fe440f00239c6e1bb3249b1 (patch)
tree4002154b76d7f1221f612ff25223a1bd87986c09 /src
parent9a25fc5abb7cf0bd5f88e7755b875fd55a62291b (diff)
qdoc: Recursively set the output subdirectory for InnerNode
When QDoc resolves and combines namespace child nodes located in different modules to be under a single namespace node, it also changes the output subdirectory of each child according to the destination module. However, if one of those child nodes is a namespace node or a class node with nested child classes, the output subdir of those children is left as the old (incorrect) directory. This change fixes that by making the setOutputSubdirectory() function recursive for nodes of type InnerNode. Change-Id: I07b2f406283e1bf3bd8643797c3b789b0211b5bb Reviewed-by: Martin Smith <>
Diffstat (limited to 'src')
2 files changed, 12 insertions, 1 deletions
diff --git a/src/tools/qdoc/node.cpp b/src/tools/qdoc/node.cpp
index a6999d3856..b2f93cc131 100644
--- a/src/tools/qdoc/node.cpp
+++ b/src/tools/qdoc/node.cpp
@@ -1199,6 +1199,16 @@ void InnerNode::removeChild(Node *child)
+ Recursively sets the output subdirectory for children
+ */
+void InnerNode::setOutputSubdirectory(const QString &t)
+ Node::setOutputSubdirectory(t);
+ for (int i = 0; i < childNodes().size(); ++i)
+ childNodes().at(i)->setOutputSubdirectory(t);
Find the module (Qt Core, Qt GUI, etc.) to which the class belongs.
We do this by obtaining the full path to the header file's location
and examine everything between "src/" and the filename. This is
diff --git a/src/tools/qdoc/node.h b/src/tools/qdoc/node.h
index 654004e425..7dd868c3c0 100644
--- a/src/tools/qdoc/node.h
+++ b/src/tools/qdoc/node.h
@@ -319,7 +319,7 @@ public:
QmlTypeNode* qmlTypeNode();
ClassNode* declarativeCppNode();
const QString& outputSubdirectory() const { return outSubDir_; }
- void setOutputSubdirectory(const QString& t) { outSubDir_ = t; }
+ virtual void setOutputSubdirectory(const QString& t) { outSubDir_ = t; }
QString fullDocumentName() const;
static QString cleanId(const QString &str);
QString idForNode() const;
@@ -410,6 +410,7 @@ public:
void printChildren(const QString& title);
void addChild(Node* child);
void removeChild(Node* child);
+ virtual void setOutputSubdirectory(const QString& t);
InnerNode(Type type, InnerNode* parent, const QString& name);