summaryrefslogtreecommitdiffstats
path: root/tools/qdoc3/generator.cpp
diff options
context:
space:
mode:
authorMartin Smith <msmith@trolltech.com>2009-06-26 11:51:51 (GMT)
committerMartin Smith <msmith@trolltech.com>2009-06-26 11:53:10 (GMT)
commit02c22119cf62873b785f9ae1628d530bcafb9ec1 (patch)
tree5379f42f4f2d944a8ba2d268677a8d32ec805b33 /tools/qdoc3/generator.cpp
parente1a0c7c01d494f7db194e3b5245368ba1d95c6c8 (diff)
downloadQt-02c22119cf62873b785f9ae1628d530bcafb9ec1.zip
Qt-02c22119cf62873b785f9ae1628d530bcafb9ec1.tar.gz
Qt-02c22119cf62873b785f9ae1628d530bcafb9ec1.tar.bz2
qdoc: Changed handling of reimplemented functions.
There are now sections for "Reimplemented Public Functions" and "Reimplemented Protected Functions" in the summaries for each class. This isn't complete yet. It introduces a lot of qdoc warnings about undocumented parameters, but I will fix those. There is more to be done here but i want to get some feedback already. Task-number: 162182, 222650
Diffstat (limited to 'tools/qdoc3/generator.cpp')
-rw-r--r--tools/qdoc3/generator.cpp29
1 files changed, 25 insertions, 4 deletions
diff --git a/tools/qdoc3/generator.cpp b/tools/qdoc3/generator.cpp
index 3652071..fa55b8a 100644
--- a/tools/qdoc3/generator.cpp
+++ b/tools/qdoc3/generator.cpp
@@ -44,7 +44,7 @@
*/
#include <qdir.h>
-
+#include <qdebug.h>
#include "codemarker.h"
#include "config.h"
#include "doc.h"
@@ -307,6 +307,12 @@ void Generator::generateBody(const Node *node, CodeMarker *marker)
.arg(marker->plainFullName(node)));
}
else {
+ if (node->type() == Node::Function) {
+ const FunctionNode *func = static_cast<const FunctionNode *>(node);
+ if (func->reimplementedFrom() != 0)
+ generateReimplementedFrom(func, marker);
+ }
+
generateText(node->doc().body(), node, marker);
if (node->type() == Node::Enum) {
@@ -345,7 +351,6 @@ void Generator::generateBody(const Node *node, CodeMarker *marker)
}
else if (node->type() == Node::Function) {
const FunctionNode *func = static_cast<const FunctionNode *>(node);
-
QSet<QString> definedParams;
QList<Parameter>::ConstIterator p = func->parameters().begin();
while (p != func->parameters().end()) {
@@ -404,9 +409,11 @@ void Generator::generateBody(const Node *node, CodeMarker *marker)
if (!body.contains("return", Qt::CaseInsensitive))
node->doc().location().warning(tr("Undocumented return value"));
}
-
+#if 0
+ // Now we put this at the top, before the other text.
if (func->reimplementedFrom() != 0)
generateReimplementedFrom(func, marker);
+#endif
}
}
@@ -859,7 +866,8 @@ void Generator::generateReimplementedFrom(const FunctionNode *func,
if (from->access() != Node::Private && from->parent()->access() != Node::Private) {
Text text;
text << Atom::ParaLeft << "Reimplemented from ";
- appendFullName(text, from->parent(), func, marker, from);
+ QString fullName = from->parent()->name() + "::" + from->name() + "()";
+ appendFullName(text, from->parent(), fullName, from);
text << "." << Atom::ParaRight;
generateText(text, func, marker);
}
@@ -939,6 +947,19 @@ void Generator::appendFullName(Text& text,
<< Atom(Atom::FormattingRight, ATOM_FORMATTING_LINK);
}
+void Generator::appendFullName(Text& text,
+ const Node *apparentNode,
+ const QString& fullName,
+ const Node *actualNode)
+{
+ if (actualNode == 0)
+ actualNode = apparentNode;
+ text << Atom(Atom::LinkNode, CodeMarker::stringForNode(actualNode))
+ << Atom(Atom::FormattingLeft, ATOM_FORMATTING_LINK)
+ << Atom(Atom::String, fullName)
+ << Atom(Atom::FormattingRight, ATOM_FORMATTING_LINK);
+}
+
void Generator::appendSortedNames(Text& text,
const ClassNode *classe,
const QList<RelatedClass> &classes,