summaryrefslogtreecommitdiffstats
path: root/tools/qdoc3/htmlgenerator.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/qdoc3/htmlgenerator.cpp')
-rw-r--r--tools/qdoc3/htmlgenerator.cpp35
1 files changed, 24 insertions, 11 deletions
diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp
index 4985f64..508c83a 100644
--- a/tools/qdoc3/htmlgenerator.cpp
+++ b/tools/qdoc3/htmlgenerator.cpp
@@ -1489,10 +1489,12 @@ void HtmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker)
generateStatus(fake, marker);
if (moduleNamespaceMap.contains(fake->name())) {
+ out() << "<a name=\"" << registerRef("namespaces") << "\"></a>\n";
out() << "<h2>Namespaces</h2>\n";
generateAnnotatedList(fake, marker, moduleNamespaceMap[fake->name()]);
}
if (moduleClassMap.contains(fake->name())) {
+ out() << "<a name=\"" << registerRef("classes") << "\"></a>\n";
out() << "<h2>Classes</h2>\n";
generateAnnotatedList(fake, marker, moduleClassMap[fake->name()]);
}
@@ -2028,24 +2030,37 @@ void HtmlGenerator::generateTableOfContents(const Node *node,
*/
void HtmlGenerator::generateTableOfContents(const Node *node, CodeMarker *marker)
{
- if (!node->doc().hasTableOfContents())
- return;
+ if (!node->doc().hasTableOfContents()) {
+ if (node->subType() != Node::Module)
+ return;
+ }
QList<Atom *> toc = node->doc().tableOfContents();
- if (toc.isEmpty())
- return;
+ if (toc.isEmpty()) {
+ if (node->subType() != Node::Module)
+ return;
+ }
Doc::SectioningUnit sectioningUnit = Doc::Section4;
- QString nodeName = node->name();
-
QStringList sectionNumber;
- int columnSize = 0;
// disable nested links in table of contents
inContents = true;
inLink = true;
out() << "<div class=\"toc\">\n";
-
+ sectionNumber.append("1");
+ out() << "<ul class=\"level" << sectionNumber.size() << "\">\n";
+
+ if (node->subType() == Node::Module) {
+ if (moduleNamespaceMap.contains(node->name())) {
+ out() << "<li><a href=\"#" << registerRef("namespaces") << "\">Namespaces</a></li>\n";
+ }
+ if (moduleClassMap.contains(node->name())) {
+ out() << "<li><a href=\"#" << registerRef("classes") << "\">Classes</a></li>\n";
+ }
+ out() << "<li><a href=\"#" << registerRef("details") << "\">Detailed Description</a></li>\n";
+ }
+
for (int i = 0; i < toc.size(); ++i) {
Atom *atom = toc.at(i);
@@ -2055,8 +2070,8 @@ void HtmlGenerator::generateTableOfContents(const Node *node, CodeMarker *marker
if (sectionNumber.size() < nextLevel) {
do {
- out() << "<ul>\n";
sectionNumber.append("1");
+ out() << "<ul class=\"level" << sectionNumber.size() << "\">\n";
} while (sectionNumber.size() < nextLevel);
}
else {
@@ -2075,8 +2090,6 @@ void HtmlGenerator::generateTableOfContents(const Node *node, CodeMarker *marker
<< "\">";
generateAtomList(headingText.firstAtom(), node, marker, true, numAtoms);
out() << "</a></li>\n";
-
- ++columnSize;
}
while (!sectionNumber.isEmpty()) {
out() << "</ul>\n";