summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTopi Reinio <topi.reinio@qt.io>2021-02-12 16:44:14 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-02-19 09:21:26 +0000
commitfa43144e9d97c8aa4888067c20c6c35f78baab96 (patch)
tree4e1542f51236322d2d3bf858da203d0664cb4ddf
parentbf7e066168af57eaaecc66fe983d92bcad3f2ce6 (diff)
downloadqttools-fa43144e9d97c8aa4888067c20c6c35f78baab96.tar.gz
qdoc: Allow any type of page as qhp indexTitle
As a corner case, some documentation projects may want to use something other than a \page as the index page. As a fallback, look for any node that generates a page and has a name matching with qhp.indexTitle. Change-Id: I07372e7e4e2ab030674788f59bf0cb3ec0fd2f5e Reviewed-by: Paul Wicking <paul.wicking@qt.io> (cherry picked from commit f96236f027c9e71724d7d185de6af38dc3d1e9e6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/qdoc/helpprojectwriter.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/qdoc/helpprojectwriter.cpp b/src/qdoc/helpprojectwriter.cpp
index deb9bf044..ad7c9b883 100644
--- a/src/qdoc/helpprojectwriter.cpp
+++ b/src/qdoc/helpprojectwriter.cpp
@@ -657,7 +657,9 @@ void HelpProjectWriter::generateProject(HelpProject &project)
writer.writeStartElement("toc");
writer.writeStartElement("section");
const Node *node = qdb_->findPageNodeByTitle(project.indexTitle);
- if (node == nullptr)
+ if (!node)
+ node = qdb_->findNodeByNameAndType(QStringList(project.indexTitle), &Node::isPageNode);
+ if (!node)
node = qdb_->findNodeByNameAndType(QStringList("index.html"), &Node::isPageNode);
QString indexPath;
if (node)