From 4cdcfe335eba1142c6b9a56408b88caa6660974c Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Thu, 15 Oct 2020 11:19:12 +0200 Subject: qdoc: Unify generated documentation between \typedef and \typealias MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit \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ƶ --- src/qdoc/cppcodemarker.cpp | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'src/qdoc/cppcodemarker.cpp') diff --git a/src/qdoc/cppcodemarker.cpp b/src/qdoc/cppcodemarker.cpp index 341b8b651..a52a42b16 100644 --- a/src/qdoc/cppcodemarker.cpp +++ b/src/qdoc/cppcodemarker.cpp @@ -98,7 +98,6 @@ QString CppCodeMarker::markedUpSynopsis(const Node *node, const Node * /* relati const PropertyNode *property; const VariableNode *variable; const EnumNode *enume; - const TypedefNode *typedeff; QString synopsis; QString name; @@ -213,22 +212,17 @@ QString CppCodeMarker::markedUpSynopsis(const Node *node, const Node * /* relati } break; case Node::TypeAlias: - if (style == Section::Summary) - synopsis = "(alias) "; - else if (style == Section::Details) { + if (style == Section::Details) { QString templateDecl = node->templateDecl(); if (!templateDecl.isEmpty()) - synopsis = templateDecl + QLatin1Char(' '); + synopsis += templateDecl + QLatin1Char(' '); } synopsis += name; break; case Node::Typedef: - typedeff = static_cast(node); - if (typedeff->associatedEnum()) { - synopsis = "flags " + name; - } else { - synopsis = "typedef " + name; - } + if (static_cast(node)->associatedEnum()) + synopsis = "flags "; + synopsis += name; break; case Node::Property: property = static_cast(node); -- cgit v1.2.1