diff options
author | Martin Smith <martin.smith@digia.com> | 2014-10-30 15:22:17 +0100 |
---|---|---|
committer | Martin Smith <martin.smith@digia.com> | 2014-11-12 08:11:04 +0100 |
commit | 1936e4973f6309ece1b83a886c6c6d9211e2155e (patch) | |
tree | 550827c552fe93037426073519bc312fdc638a39 /src/tools/qdoc/tree.cpp | |
parent | 8bed6b6a7ffd3961f3da726d551f5e2563d95965 (diff) |
qdoc: Generate \keyword anchors at the top of the page
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ƶ <topi.reinio@digia.com>
Diffstat (limited to 'src/tools/qdoc/tree.cpp')
-rw-r--r-- | src/tools/qdoc/tree.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tools/qdoc/tree.cpp b/src/tools/qdoc/tree.cpp index 6610bd0db4..819951d0e0 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(); |