diff options
author | Topi Reinio <topi.reinio@qt.io> | 2020-10-15 11:19:12 +0200 |
---|---|---|
committer | Topi Reinio <topi.reinio@qt.io> | 2020-11-09 23:30:45 +0100 |
commit | 4cdcfe335eba1142c6b9a56408b88caa6660974c (patch) | |
tree | b0f835a83305d6826e67101cf300bd7c28d2b404 /src/qdoc/xmlgenerator.cpp | |
parent | 12f8258efcab39a571df4cbb8cacf5bfc2eb8a82 (diff) | |
download | qttools-4cdcfe335eba1142c6b9a56408b88caa6660974c.tar.gz |
qdoc: Unify generated documentation between \typedef and \typealias
\typedef can be used as a substitute for \typealias for documenting
aliases. Since they are identical in terms of usage, unify also the
way they are documented:
- Remove 'typedef' and '(alias)' from both the summary and details
sections, making both appear as types.
- Remove automatically generated 'This is a type alias for ...' note
for type aliases. This typically resulted in duplicate statements.
- Use '-typedef' anchor suffix for both.
- Use 'typedef' as element for both in .index files and webxml output
format.
- Add template parameters for type aliases for DocBook generator;
these were previously missing.
Fixes: QTBUG-87622
Change-Id: I93986a2dc91c3c3dff9e21f5bf5cf19d0b55c4df
Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io>
Diffstat (limited to 'src/qdoc/xmlgenerator.cpp')
-rw-r--r-- | src/qdoc/xmlgenerator.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/qdoc/xmlgenerator.cpp b/src/qdoc/xmlgenerator.cpp index 19761c31e..1ccaaf6cb 100644 --- a/src/qdoc/xmlgenerator.cpp +++ b/src/qdoc/xmlgenerator.cpp @@ -242,15 +242,14 @@ QString XmlGenerator::refForNode(const Node *node) case Node::Enum: ref = node->name() + "-enum"; break; - case Node::TypeAlias: - ref = node->name() + "-alias"; - break; case Node::Typedef: { - const auto tdn = static_cast<const TypedefNode *>(node); - if (tdn->associatedEnum()) - return refForNode(tdn->associatedEnum()); + const auto *tdf = static_cast<const TypedefNode *>(node); + if (tdf->associatedEnum()) + return refForNode(tdf->associatedEnum()); + } Q_FALLTHROUGH(); + case Node::TypeAlias: ref = node->name() + "-typedef"; - } break; + break; case Node::Function: { const auto fn = static_cast<const FunctionNode *>(node); switch (fn->metaness()) { |