diff options
author | Paul Wicking <paul.wicking@qt.io> | 2021-03-19 11:16:26 +0100 |
---|---|---|
committer | Topi Reinio <topi.reinio@qt.io> | 2021-05-10 11:09:39 +0200 |
commit | c366087381978465049e65fffa48ab19974ecb92 (patch) | |
tree | 9bb25312ae68f28f23e19fb3ab578e10c7d1545c /src/qdoc/cppcodemarker.cpp | |
parent | ae369522c03a7c0f22a1894c740f78f8afa4989b (diff) | |
download | qttools-c366087381978465049e65fffa48ab19974ecb92.tar.gz |
Doc: Improve \deprecated command
This change allows users to specify an optional parameter
to the \deprecated command to record which version something
was deprecated. It also allows for free text descriptions.
These descriptions become the first paragraph of the resulting
documentation.
Usage:
\deprecated
\deprecated [6.2]
\deprecated [6.2] Use QFoo() instead.
\deprecated Use QFoo() instead.
[ChangeLog][qdoc] QDoc now lets you record the version something
is deprecated and suggest replacements with the \deprecated command.
Task-number: QTBUG-58249
Change-Id: I27081627132b2f8ea3dd7d48ded8e37213366074
Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Diffstat (limited to 'src/qdoc/cppcodemarker.cpp')
-rw-r--r-- | src/qdoc/cppcodemarker.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/qdoc/cppcodemarker.cpp b/src/qdoc/cppcodemarker.cpp index 0f9f92ecf..3b0a9a771 100644 --- a/src/qdoc/cppcodemarker.cpp +++ b/src/qdoc/cppcodemarker.cpp @@ -295,10 +295,12 @@ QString CppCodeMarker::markedUpQmlItem(const Node *node, bool summary) if (summary) { if (node->isPreliminary()) extra += " (preliminary)"; - else if (node->isDeprecated()) - extra += " (deprecated)"; - else if (node->isDeprecated()) - extra += " (obsolete)"; + else if (node->isDeprecated()) { + if (const QString &version = node->deprecatedSince(); !version.isEmpty()) + extra += " (deprecated since " + version + ")"; + else + extra += " (deprecated)"; + } } if (!extra.isEmpty()) { |