From 1936e4973f6309ece1b83a886c6c6d9211e2155e Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Thu, 30 Oct 2014 15:22:17 +0100 Subject: qdoc: Generate \keyword anchors at the top of the page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently, qdoc processes \keyword and \target the same way. The negative effect of this is that when either command appears at the top of a qdoc comment, the anchor it generates in the html file is just above the details section on the html page. This is usually wrong, especially for \keyword commands, where the anchor generated should always be at the top of the page/text where the \keyword appears. This update implements that. \target anchors are meant to be used when the anchor should appear somewhere in the middle of the page/text, exactly where the \target command appears. Change-Id: Ibbbf1087562a977ff74ccd98febfe9310ecba8f0 Task-number: QTBUG-42290 Reviewed-by: Topi Reiniƶ --- src/tools/qdoc/tree.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/tools/qdoc/tree.cpp') diff --git a/src/tools/qdoc/tree.cpp b/src/tools/qdoc/tree.cpp index 6610bd0db4d..819951d0e05 100644 --- a/src/tools/qdoc/tree.cpp +++ b/src/tools/qdoc/tree.cpp @@ -1135,7 +1135,7 @@ QString Tree::refForAtom(const Atom* atom) if (atom) { if (atom->type() == Atom::SectionLeft) return Doc::canonicalTitle(Text::sectionHeading(atom).toString()); - if (atom->type() == Atom::Target) + if ((atom->type() == Atom::Target) || (atom->type() == Atom::Keyword)) return Doc::canonicalTitle(atom->string()); } return QString(); -- cgit v1.2.3