From 3062cea229ebd10369c68f08ef4bb5aabd801d5e Mon Sep 17 00:00:00 2001 From: Jerome Pasion Date: Thu, 5 Sep 2013 10:41:20 +0200 Subject: Doc: Get QDoc to list the QT variable for namespaces. Task-number: QTBUG-32172 Change-Id: Id774b5d5036661a6f6b56b9c68f089031288eacc Reviewed-by: Martin Smith --- src/tools/qdoc/htmlgenerator.cpp | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'src/tools') diff --git a/src/tools/qdoc/htmlgenerator.cpp b/src/tools/qdoc/htmlgenerator.cpp index 2caa2f8332..52af5d60b9 100644 --- a/src/tools/qdoc/htmlgenerator.cpp +++ b/src/tools/qdoc/htmlgenerator.cpp @@ -1886,7 +1886,20 @@ void HtmlGenerator::generateRequisites(InnerNode *inner, CodeMarker *marker) requisites.insert(sinceText, text); } - //add the instantiated-by to the map if the class node is not internal + if (inner->type() == Node::Class || inner->type() == Node::Namespace) { + //add the QT variable to the map + if (!inner->moduleName().isEmpty()) { + DocNode * moduleNode = qdb_->findModule(inner->moduleName()); + if (moduleNode && !moduleNode->qtVariable().isEmpty()) { + text.clear(); + text << Atom(Atom::FormattingLeft, ATOM_FORMATTING_TELETYPE) + << "QT += " + moduleNode->qtVariable() + << Atom(Atom::FormattingRight, ATOM_FORMATTING_TELETYPE); + requisites.insert(qtVariableText, text); + } + } + } + if (inner->type() == Node::Class) { ClassNode* classe = static_cast(inner); if (classe->qmlElement() != 0 && classe->status() != Node::Internal) { @@ -1933,18 +1946,6 @@ void HtmlGenerator::generateRequisites(InnerNode *inner, CodeMarker *marker) text << Atom::ParaRight; requisites.insert(inheritedBytext, text); } - - //add the QT variable to the map - if (!classe->moduleName().isEmpty()) { - DocNode * moduleNode = qdb_->findModule(classe->moduleName()); - if (moduleNode && !moduleNode->qtVariable().isEmpty()) { - text.clear(); - text << Atom(Atom::FormattingLeft, ATOM_FORMATTING_TELETYPE) - << "QT += " + moduleNode->qtVariable() - << Atom(Atom::FormattingRight, ATOM_FORMATTING_TELETYPE); - requisites.insert(qtVariableText, text); - } - } } if (!requisites.isEmpty()) { -- cgit v1.2.3