summaryrefslogtreecommitdiff
path: root/src/qdoc/cppcodeparser.cpp
diff options
context:
space:
mode:
authorPaul Wicking <paul.wicking@qt.io>2021-03-19 11:16:26 +0100
committerPaul Wicking <paul.wicking@qt.io>2021-04-28 12:39:04 +0200
commit1637d91efd8fb389bc09bdaa960f5d9d4f9e0164 (patch)
tree17d5a8aea7e85f57b9f8e9cdbcbac58b83a0f16f /src/qdoc/cppcodeparser.cpp
parentcbc5277f1d38bad75ced13d20f9ef914bc9b5950 (diff)
downloadqttools-1637d91efd8fb389bc09bdaa960f5d9d4f9e0164.tar.gz
QDoc: Add \deprecatedsince command
As deprecated methods may stick around over a couple of versions, add a command that lets us record which version something was deprecated in. [ChangeLog][qdoc] QDoc now lets you record the version something is deprecated in with the new \deprecatedsince command. Fixes: QTBUG-58249 Change-Id: I69de350502580f446008f717462bbc1c4c251564 Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io>
Diffstat (limited to 'src/qdoc/cppcodeparser.cpp')
-rw-r--r--src/qdoc/cppcodeparser.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/qdoc/cppcodeparser.cpp b/src/qdoc/cppcodeparser.cpp
index 106e5f75d..7f03f6707 100644
--- a/src/qdoc/cppcodeparser.cpp
+++ b/src/qdoc/cppcodeparser.cpp
@@ -522,7 +522,7 @@ void CppCodeParser::processMetaCommand(const Doc &doc, const QString &command,
if (node->isFunction()) {
auto *fn = static_cast<FunctionNode *>(node);
// The clang visitor class will have set the
- // qualified name of the ovverridden function.
+ // qualified name of the overridden function.
// If the name of the overridden function isn't
// set, issue a warning.
if (fn->overridesThis().isEmpty() && isWorthWarningAbout(doc)) {
@@ -625,7 +625,13 @@ void CppCodeParser::processMetaCommand(const Doc &doc, const QString &command,
if (node->isQmlType() || node->isJsType())
node->setAbstract(true);
} else if (command == COMMAND_DEPRECATED) {
- node->setStatus(Node::Obsolete);
+ node->setStatus(Node::Deprecated);
+ } else if (command == COMMAND_DEPRECATED_SINCE) {
+ if (!arg.isEmpty())
+ node->setDeprecatedSince(arg);
+ else
+ doc.location().warning(
+ QStringLiteral("Missing since version for \\%1").arg(COMMAND_DEPRECATED_SINCE));
} else if (command == COMMAND_INGROUP || command == COMMAND_INPUBLICGROUP) {
// Note: \ingroup and \inpublicgroup are the same (and now recognized as such).
qdb_->addToGroup(arg, node);