diff options
author | Martin Smith <martin.smith@digia.com> | 2015-01-15 11:52:53 +0100 |
---|---|---|
committer | Martin Smith <martin.smith@digia.com> | 2015-01-17 11:04:40 +0100 |
commit | 1bbcad9e5e011dedd7706a10e221a6f442781df9 (patch) | |
tree | c78940ea1a4709726ca2ba6af11297e2495ea03e /src/tools/qdoc/htmlgenerator.cpp | |
parent | 70ed7c727aebdc7b3b149f95a3900cd60b76d1b1 (diff) |
qdoc: Fixed broken links for abstract QML types
When a QML base type is abstract, the documentation for its properties
is supposed to appear on the reference page for each QML type that
inherits the abstract type. And then links to those properties from
within the property documentation must refer to the documentation for
that property on the reference page for the particular inheriting QML
type. These links were dead, but this fix corrects the problem.
Change-Id: Icaf01d67edf44567099f5a6a59fd6348de8df380
Task-number: QTBUG-43200
Reviewed-by: Nico Vertriest <nico.vertriest@digia.com>
Reviewed-by: Tero Kojo <tero.kojo@digia.com>
Reviewed-by: Topi Reiniƶ <topi.reinio@digia.com>
Diffstat (limited to 'src/tools/qdoc/htmlgenerator.cpp')
-rw-r--r-- | src/tools/qdoc/htmlgenerator.cpp | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/src/tools/qdoc/htmlgenerator.cpp b/src/tools/qdoc/htmlgenerator.cpp index bb1f9cd651..22c44bd7f6 100644 --- a/src/tools/qdoc/htmlgenerator.cpp +++ b/src/tools/qdoc/htmlgenerator.cpp @@ -1532,6 +1532,7 @@ void HtmlGenerator::generateClassLikeNode(InnerNode* inner, CodeMarker* marker) */ void HtmlGenerator::generateQmlTypePage(QmlClassNode* qcn, CodeMarker* marker) { + Generator::setQmlTypeContext(qcn); SubTitleSize subTitleSize = LargeSubTitle; QList<Section>::const_iterator s; QString htmlTitle = qcn->fullTitle() + " QML Type"; @@ -1595,6 +1596,7 @@ void HtmlGenerator::generateQmlTypePage(QmlClassNode* qcn, CodeMarker* marker) ++s; } generateFooter(qcn); + Generator::setQmlTypeContext(0); } /*! @@ -3894,8 +3896,9 @@ QString HtmlGenerator::getAutoLink(const Atom *atom, const Node *relative, const QString ref; *node = qdb_->findNodeForAtom(atom, relative, ref); - if (!(*node)) + if (!(*node)) { return QString(); + } QString link = (*node)->url(); if (link.isEmpty()) { @@ -3933,21 +3936,9 @@ QString HtmlGenerator::linkForNode(const Node *node, const Node *relative) return QString(); QString fn = fileName(node); - if (node && relative && node->parent() != relative) { - if (node->parent()->isQmlType() && relative->isQmlType()) { - if (node->parent()->isAbstract()) { - /* - This is a bit of a hack. What we discover with - the three 'if' statements immediately above, - is that node's parent is marked \qmlabstract - but the link appears in a qdoc comment for a - subclass of the node's parent. This means the - link should refer to the file for the relative - node, not the file for node. - */ - fn = fileName(relative); - } - } + if (node && node->parent() && node->parent()->isQmlType() && node->parent()->isAbstract()) { + if (Generator::qmlTypeContext()) + fn = fileName(Generator::qmlTypeContext()); } QString link = fn; |