summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.pl@gmail.com>2011-08-02 16:59:33 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2011-08-02 17:39:50 -0300
commit127ad5d710b3b584666efd6d939bf068b0b9d202 (patch)
treeb42a7c337afe029ec715ed67e519449a48b42ff6
parentdde4bf2ee0104bf421044a3f6196bf678a8b237a (diff)
downloadgeneratorrunner-127ad5d710b3b584666efd6d939bf068b0b9d202.tar.gz
generatorrunner-127ad5d710b3b584666efd6d939bf068b0b9d202.tar.xz
generatorrunner-127ad5d710b3b584666efd6d939bf068b0b9d202.zip
Fix bug 831 - "PySide docs would have a "Inherited by" list for each class"
Reviewer: Marcelo Lira <marcelo.lira@openbossa.org> Luciano Wolf <luciano.wolf@openbossa.org>
-rw-r--r--generators/qtdoc/qtdocgenerator.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/generators/qtdoc/qtdocgenerator.cpp b/generators/qtdoc/qtdocgenerator.cpp
index b7dac85..05a452a 100644
--- a/generators/qtdoc/qtdocgenerator.cpp
+++ b/generators/qtdoc/qtdocgenerator.cpp
@@ -947,6 +947,24 @@ void QtDocGenerator::writeFormatedText(QTextStream& s, const Documentation& doc,
s << endl;
}
+static void writeInheritedByList(QTextStream& s, const AbstractMetaClass* metaClass, const AbstractMetaClassList& allClasses)
+{
+ AbstractMetaClassList res;
+ foreach (AbstractMetaClass* c, allClasses) {
+ if (c != metaClass && c->inheritsFrom(metaClass))
+ res << c;
+ }
+
+ if (res.isEmpty())
+ return;
+
+ s << "**Inherited by:** ";
+ QStringList classes;
+ foreach (AbstractMetaClass* c, res)
+ classes << QString(":ref:`%1`").arg(getClassTargetFullName(c, false));
+ s << classes.join(", ") << endl << endl;
+}
+
void QtDocGenerator::generateClass(QTextStream& s, const AbstractMetaClass* metaClass)
{
ReportHandler::debugSparse("Generating Documentation for " + metaClass->fullName());
@@ -966,6 +984,9 @@ void QtDocGenerator::generateClass(QTextStream& s, const AbstractMetaClass* meta
s << ".. inheritance-diagram:: " << className << endl
<< " :parts: 2" << endl << endl; // TODO: This would be a parameter in the future...
+
+ writeInheritedByList(s, metaClass, classes());
+
if (metaClass->typeEntry() && (metaClass->typeEntry()->version() != 0))
s << ".. note:: This class was introduced in Qt " << metaClass->typeEntry()->version() << endl;