summaryrefslogtreecommitdiffstats
path: root/src/tools/qdoc/tree.cpp
diff options
context:
space:
mode:
authorMartin Smith <martin.smith@digia.com>2012-12-04 14:12:30 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-12-05 17:29:46 +0100
commitfd1f65a9b84d597078482cd420771620c406f8da (patch)
treeb6d35944932d4723094cb6bd989066cb127499ff /src/tools/qdoc/tree.cpp
parent4b819803f63ea58ac4cc4e8bc61f12321f91197a (diff)
qdoc: Don't include inherited members in the class ref
Once upon a time, the inherited functions, signals, slots, etc were not listed on the class reference page, but they were counted and a link to the base class was provided for them, eg: 2 public functions inherited from QAbstractListModel 39 public functions inherited from QAbstractItemModel 31 public functions inherited from QObject Somehow, this got broken, so that all these inherited things were listed on the class reference page as if they were members of the class. But they liunked to the documentation in the base class. This now works correctly again. It simnplifies the class reference pages a lot. Task-number: QTBUG-27496 Change-Id: If493da8cbf81634f1344b12094d9a06f8528e8e5 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/tools/qdoc/tree.cpp')
-rw-r--r--src/tools/qdoc/tree.cpp48
1 files changed, 33 insertions, 15 deletions
diff --git a/src/tools/qdoc/tree.cpp b/src/tools/qdoc/tree.cpp
index c622fb929b..e7a8f5b5d0 100644
--- a/src/tools/qdoc/tree.cpp
+++ b/src/tools/qdoc/tree.cpp
@@ -398,6 +398,11 @@ void Tree::addPropertyFunction(PropertyNode* property,
}
/*!
+ This function resolves inheritance and reimplementation settings
+ for each class node found in the namspace beginning ar \a rootNode.
+ If it finds another namespace node in the child list of \a rootNode,
+ it calls itself recursively. For each child of \a rootNode that is a
+ class node, it calls the other resolveInheritance() function.
*/
void Tree::resolveInheritance(NamespaceNode* rootNode)
{
@@ -475,11 +480,24 @@ void Tree::resolveProperties()
}
/*!
+ This function is run twice for each \a classNode in the
+ tree. First it is run with \a pass set to 0 for each
+ \a classNode. Then it is run with \a pass set to 1 for
+ each \a classNode.
+
+ In \a pass 0, all the base classes of \a classNode are
+ found and added to the base class list for \a classNode.
+
+ In \a pass 1, each child of \a classNode that is a function
+ that is reimplemented from one of the base classes is marked
+ as being reimplemented from that class.
+
+ Some property node fixing up is also done in \a pass 1.
*/
-void Tree::resolveInheritance(int pass, ClassNode* classe)
+void Tree::resolveInheritance(int pass, ClassNode* classNode)
{
if (pass == 0) {
- QList<InheritanceBound> bounds = unresolvedInheritanceMap[classe];
+ QList<InheritanceBound> bounds = unresolvedInheritanceMap[classNode];
QList<InheritanceBound>::ConstIterator b = bounds.constBegin();
while (b != bounds.constEnd()) {
Node* n = findClassNode((*b).basePath);
@@ -487,17 +505,17 @@ void Tree::resolveInheritance(int pass, ClassNode* classe)
n = findClassNode((*b).basePath, (*b).parent);
}
if (n) {
- classe->addBaseClass((*b).access, static_cast<ClassNode*>(n), (*b).dataTypeWithTemplateArgs);
+ classNode->addBaseClass((*b).access, static_cast<ClassNode*>(n), (*b).dataTypeWithTemplateArgs);
}
++b;
}
}
else {
- NodeList::ConstIterator c = classe->childNodes().constBegin();
- while (c != classe->childNodes().constEnd()) {
+ NodeList::ConstIterator c = classNode->childNodes().constBegin();
+ while (c != classNode->childNodes().constEnd()) {
if ((*c)->type() == Node::Function) {
FunctionNode* func = (FunctionNode*)* c;
- FunctionNode* from = findVirtualFunctionInBaseClasses(classe, func);
+ FunctionNode* from = findVirtualFunctionInBaseClasses(classNode, func);
if (from != 0) {
if (func->virtualness() == FunctionNode::NonVirtual)
func->setVirtualness(FunctionNode::ImpureVirtual);
@@ -505,7 +523,7 @@ void Tree::resolveInheritance(int pass, ClassNode* classe)
}
}
else if ((*c)->type() == Node::Property) {
- fixPropertyUsingBaseClasses(classe, static_cast<PropertyNode*>(*c));
+ fixPropertyUsingBaseClasses(classNode, static_cast<PropertyNode*>(*c));
}
++c;
}
@@ -551,11 +569,11 @@ void Tree::fixInheritance(NamespaceNode* rootNode)
/*!
*/
-FunctionNode* Tree::findVirtualFunctionInBaseClasses(ClassNode* classe,
+FunctionNode* Tree::findVirtualFunctionInBaseClasses(ClassNode* classNode,
FunctionNode* clone)
{
- QList<RelatedClass>::ConstIterator r = classe->baseClasses().constBegin();
- while (r != classe->baseClasses().constEnd()) {
+ QList<RelatedClass>::ConstIterator r = classNode->baseClasses().constBegin();
+ while (r != classNode->baseClasses().constEnd()) {
FunctionNode* func;
if (((func = findVirtualFunctionInBaseClasses((*r).node, clone)) != 0 ||
(func = (*r).node->findFunctionNode(clone)) != 0)) {
@@ -569,10 +587,10 @@ FunctionNode* Tree::findVirtualFunctionInBaseClasses(ClassNode* classe,
/*!
*/
-void Tree::fixPropertyUsingBaseClasses(ClassNode* classe, PropertyNode* property)
+void Tree::fixPropertyUsingBaseClasses(ClassNode* classNode, PropertyNode* property)
{
- QList<RelatedClass>::const_iterator r = classe->baseClasses().constBegin();
- while (r != classe->baseClasses().constEnd()) {
+ QList<RelatedClass>::const_iterator r = classNode->baseClasses().constBegin();
+ while (r != classNode->baseClasses().constEnd()) {
Node* n = r->node->findChildNodeByNameAndType(property->name(), Node::Property);
if (n) {
PropertyNode* baseProperty = static_cast<PropertyNode*>(n);
@@ -588,10 +606,10 @@ void Tree::fixPropertyUsingBaseClasses(ClassNode* classe, PropertyNode* property
/*!
*/
-NodeList Tree::allBaseClasses(const ClassNode* classe) const
+NodeList Tree::allBaseClasses(const ClassNode* classNode) const
{
NodeList result;
- foreach (const RelatedClass& r, classe->baseClasses()) {
+ foreach (const RelatedClass& r, classNode->baseClasses()) {
result += r.node;
result += allBaseClasses(r.node);
}