diff options
author | Topi Reinio <topi.reinio@qt.io> | 2023-04-21 07:40:43 +0000 |
---|---|---|
committer | Topi Reinio <topi.reinio@qt.io> | 2023-04-24 18:39:40 +0000 |
commit | 34d28f769f87ff876748e1db3e7bf12ec04d4ff7 (patch) | |
tree | 8eece54047855e2f2664fa2e7e5b69f941d46d07 /src/qdoc/qdoc/generator.cpp | |
parent | 046447a6fa686ed076a7df8d27b00abe0811750b (diff) | |
download | qttools-34d28f769f87ff876748e1db3e7bf12ec04d4ff7.tar.gz |
qdoc: Allow custom status descriptions for C++, QML types
QDoc already allows defining a custom status for C++ and QML modules
via the \modulestate command. In Qt, this is typically used for
marking a module and its types with 'Technology preview' status.
Allow a custom status for individual types as well, with
\meta {status} {<description>} command. This information is added
to the 'Requisites' table on top of the type reference page.
Document the new status argument for \meta, and update its
documentation as it contained obsolete information.
Pick-to: 6.5
Task-number: QTBUG-113026
Change-Id: I5a13aa8650b6e188ffe50a1e948da90474bfb7a0
Reviewed-by: Luca Di Sera <luca.disera@qt.io>
Diffstat (limited to 'src/qdoc/qdoc/generator.cpp')
-rw-r--r-- | src/qdoc/qdoc/generator.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/qdoc/qdoc/generator.cpp b/src/qdoc/qdoc/generator.cpp index 174cb9c8f..0381040d9 100644 --- a/src/qdoc/qdoc/generator.cpp +++ b/src/qdoc/qdoc/generator.cpp @@ -1112,6 +1112,8 @@ QString Generator::formatSince(const Node *node) If a status description is returned, it is one of: \list + \li Custom status set explicitly in node's documentation using + \c {\meta {status} {<description>}}, \li 'Deprecated [since <version>]' (\\deprecated [<version>]), \li 'Preliminary' (\\preliminary), or \li The description adopted from associated module's state: @@ -1124,7 +1126,9 @@ std::optional<QString> formatStatus(const Node *node, QDocDatabase *qdb) { QString status; - if (node->status() == Node::Deprecated) { + if (const auto metaMap = node->doc().metaTagMap(); metaMap) { + status = metaMap->value("status"); + } else if (node->status() == Node::Deprecated) { status = u"Deprecated"_s; if (const auto since = node->deprecatedSince(); !since.isEmpty()) status += " since %1"_L1.arg(since); |