From e967772fe884dd8a488a359c122c9cbae9d94c55 Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Tue, 21 Apr 2020 23:57:46 +0200 Subject: qdoc: properly implement \typealias command \typealias was already a command recognized by QDoc, but it was simply treated as a synonym for \typedef and was not documented. Implement proper support for the command: - Add [alias] designation both in type summary and details. - Auto-generate information about the aliased type, including a link if aliasing a public, documented type. - Auto-convert aliases documented with \typedef to type aliases. - Add basic support for aliases also to DocBook and WebXML generators. - Document \typealias. Fixes: QTBUG-82712 Change-Id: Iafa8c7def0a7488d7521fbc2862290a9bb3167ff Reviewed-by: Qt CI Bot Reviewed-by: Paul Wicking --- src/qdoc/doc/qdoc-manual-topiccmds.qdoc | 36 +++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'src/qdoc/doc/qdoc-manual-topiccmds.qdoc') diff --git a/src/qdoc/doc/qdoc-manual-topiccmds.qdoc b/src/qdoc/doc/qdoc-manual-topiccmds.qdoc index 8e142f5af..a537c7499 100644 --- a/src/qdoc/doc/qdoc-manual-topiccmds.qdoc +++ b/src/qdoc/doc/qdoc-manual-topiccmds.qdoc @@ -1410,6 +1410,40 @@ {\\instantiates} to specify that a Transform is instantiated by the C++ class QGraphicsTransform. A \\qmltype comment should + \target typealias-command + \section1 \\typealias + + The \\typealias command is similar to \l {typedef-command}{\\typedef}, + but specific to documenting a C++ type alias: + + \code + class Foo + { + public: + using ptr = void*; + // ... + } + \endcode + + This can be documented as + + \badcode * + /\1! + \typealias Foo::ptr + \1/ + \endcode + + QDoc will automatically generate a sentence in the documentation describing + the alias: + + \quotation + This is a type alias for \c {void*}. + \endquotation + + The \\typealias command was introduced in QDoc 5.15. + + See also \l {typedef-command}{\\typedef}. + \target typedef-command \section1 \\typedef @@ -1498,6 +1532,8 @@ Qt-style synonym for QList::iterator. \endquotation + See also \l {typealias-command}{\\typealias}. + \target variable-command \section1 \\variable -- cgit v1.2.3