summaryrefslogtreecommitdiff
path: root/src/qdoc/qmlvisitor.cpp
diff options
context:
space:
mode:
authorPaul Wicking <paul.wicking@qt.io>2021-03-19 11:16:26 +0100
committerTopi Reinio <topi.reinio@qt.io>2021-05-10 11:09:39 +0200
commitc366087381978465049e65fffa48ab19974ecb92 (patch)
tree9bb25312ae68f28f23e19fb3ab578e10c7d1545c /src/qdoc/qmlvisitor.cpp
parentae369522c03a7c0f22a1894c740f78f8afa4989b (diff)
downloadqttools-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/qmlvisitor.cpp')
-rw-r--r--src/qdoc/qmlvisitor.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/qdoc/qmlvisitor.cpp b/src/qdoc/qmlvisitor.cpp
index 9d40d71a2..1998f3238 100644
--- a/src/qdoc/qmlvisitor.cpp
+++ b/src/qdoc/qmlvisitor.cpp
@@ -424,6 +424,8 @@ void QmlDocVisitor::applyMetacommands(QQmlJS::SourceLocation, Node *node, Doc &d
}
} else if (command == COMMAND_DEPRECATED) {
node->setStatus(Node::Deprecated);
+ if (const QString version = doc.bracketedArgs(command); !version.isEmpty())
+ node->setDeprecatedSince(version);
} else if ((command == COMMAND_INQMLMODULE) || (command == COMMAND_INJSMODULE)) {
qdb->addToQmlModule(args[0].first, node);
} else if (command == COMMAND_QMLINHERITS) {