summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTopi Reinio <topi.reinio@qt.io>2019-01-02 11:31:31 +0100
committerMartin Smith <martin.smith@qt.io>2019-01-02 12:16:48 +0000
commite238a37c1888e069ca1a6464f9e4e8f659e53fe7 (patch)
tree5d6c05e6a089c6b80faa1cce82627cf25ce1b170
parent78de5016bb7f86face1644402b414135163d4418 (diff)
downloadqttools-e238a37c1888e069ca1a6464f9e4e8f659e53fe7.tar.gz
qdoc: Link buildversion field to navigation.landingpage
For some modules, we use the 'buildversion' string to convey module-specific information such as license type(s). Linking the page helps users navigate to the detailed information displayed (or linked from) the landing page. Task-number: QTBUG-70801 Change-Id: I7f0f8b4d5bbb0306325264101e1478842b162863 Reviewed-by: Martin Smith <martin.smith@qt.io>
-rw-r--r--src/qdoc/htmlgenerator.cpp24
1 files changed, 20 insertions, 4 deletions
diff --git a/src/qdoc/htmlgenerator.cpp b/src/qdoc/htmlgenerator.cpp
index 633ebfa0f..7eeb3705c 100644
--- a/src/qdoc/htmlgenerator.cpp
+++ b/src/qdoc/htmlgenerator.cpp
@@ -1915,13 +1915,29 @@ void HtmlGenerator::generateNavigationBar(const QString &title,
if (buildversion.isEmpty())
return;
- if (tableItems) {
+ navigationbar.clear();
+
+ if (tableItems) {
out() << "</tr></table><table class=\"buildversion\"><tr>\n"
- << "<td id=\"buildversion\" width=\"100%\" align=\"right\">"
- << buildversion << "</td>\n";
+ << "<td id=\"buildversion\" width=\"100%\" align=\"right\">";
+ } else {
+ out() << "<li id=\"buildversion\">";
+ }
+
+ // Link buildversion string to navigation.landingpage
+ if (!landingpage.isEmpty() && landingtitle != title) {
+ navigationbar << Atom(Atom::NavLink, landingpage)
+ << Atom(Atom::FormattingLeft, ATOM_FORMATTING_LINK)
+ << Atom(Atom::String, buildversion)
+ << Atom(Atom::FormattingRight, ATOM_FORMATTING_LINK);
+ generateText(navigationbar, node, marker);
} else {
- out() << "<li id=\"buildversion\">" << buildversion << "</li>\n";
+ out() << buildversion;
}
+ if (tableItems)
+ out() << "</td>\n";
+ else
+ out() << "</li>\n";
}
void HtmlGenerator::generateHeader(const QString& title,