diff options
author | Topi Reinio <topi.reinio@qt.io> | 2023-03-09 12:04:31 +0000 |
---|---|---|
committer | Topi Reinio <topi.reinio@qt.io> | 2023-03-27 07:48:44 +0000 |
commit | df735050ecd01687f17df8f161c706541319ad05 (patch) | |
tree | eedb1cb089dd5d36b4b165955a20c845d4f3cc05 /src/qdoc/cppcodeparser.cpp | |
parent | 65e94d012b7d38669e9cdc4e885bdc34a86607af (diff) | |
download | qttools-df735050ecd01687f17df8f161c706541319ad05.tar.gz |
qdoc: Add support for 'category' argument in \generatelist command
Examples in the Qt codebase are now tagged with specific categories,
using the '\meta category {Category}' command. To easily generate
lists of members in each category, add support for a 'category'
argument in the \generatelist command.
Internally, utilize the mechanism already provided by \ingroup command,
by adding the node to an internal group prefixed by 'category', when
processing the '\meta category' command.
\generatelist already supported listing members of a group as a simple
unordered list of titles/links. Fix the generated links as they were
broken, always referring to the current document.
In DocBook generator, reuse generateAnnotatedList() as it already has
support for outputting simple itemized/unordered lists. Create a new
private enum GeneratedListType to select the list 'subtype' and clean
up the API.
Add simple test case and documentation of the new argument.
Pick-to: 6.5
Fixes: QTBUG-111891
Fixes: QTBUG-111575
Change-Id: Icd5647a09b9ae8cb0ac243fa49d3d99263d397cb
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
Diffstat (limited to 'src/qdoc/cppcodeparser.cpp')
-rw-r--r-- | src/qdoc/cppcodeparser.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/qdoc/cppcodeparser.cpp b/src/qdoc/cppcodeparser.cpp index 9b425114c..685284c59 100644 --- a/src/qdoc/cppcodeparser.cpp +++ b/src/qdoc/cppcodeparser.cpp @@ -509,8 +509,11 @@ void CppCodeParser::processMetaCommand(const Doc &doc, const QString &command, if (!argPair.second.isEmpty()) node->setDeprecatedSince(argPair.second); } else if (command == COMMAND_INGROUP || command == COMMAND_INPUBLICGROUP) { - // Note: \ingroup and \inpublicgroup are the same (and now recognized as such). - database->addToGroup(arg, node); + // Use bracketed argument as a prefix; used internally by '\meta category' + if (!argPair.second.isEmpty()) + database->addToGroup(argPair.second + " " + arg, node); + else + database->addToGroup(arg, node); } else if (command == COMMAND_INMODULE) { database->addToModule(arg, node); } else if (command == COMMAND_INQMLMODULE) { |