diff options
author | Topi Reinio <topi.reinio@qt.io> | 2021-08-20 18:01:02 +0200 |
---|---|---|
committer | Topi Reiniƶ <topi.reinio@qt.io> | 2021-08-23 12:22:10 +0000 |
commit | 76fb767296e12235d93da683a7f2feb84a7a6675 (patch) | |
tree | 9b94000c1e1b4c4ea1e5c766b22cedca0ed33fa4 /src/qdoc/qmlvisitor.cpp | |
parent | e64a8cce3c31ab00afee959854621ae83f494ce1 (diff) | |
download | qttools-76fb767296e12235d93da683a7f2feb84a7a6675.tar.gz |
qdoc: Improve function tagging for grouped \fn commands
QDoc provides a mechanism for tagging specific function declarations
in a header with //! [tag] comments, allowing these tags to be
referenced in an \fn command. This feature did not work for
shared comment nodes containing multiple \fn commands, however.
To make this work, we need to associate the 'bracketed args' (where
the id tag is) with the command itself - previously it was stored
in the Doc instance, but that doesn't work when there are multiple
topic commands sharing a doc. To do so, repurpose the ArgLocPair
structure to store the bracketed arg instead of a Location, as we
never used this particular Location for anything, anyway.
Pick-to: 6.2
Fixes: QTBUG-95948
Change-Id: Ic899d4252d705f84ba56ea201a55f3e5db068f00
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Diffstat (limited to 'src/qdoc/qmlvisitor.cpp')
-rw-r--r-- | src/qdoc/qmlvisitor.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/qdoc/qmlvisitor.cpp b/src/qdoc/qmlvisitor.cpp index 5f7edde35..9c46ac661 100644 --- a/src/qdoc/qmlvisitor.cpp +++ b/src/qdoc/qmlvisitor.cpp @@ -424,8 +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); + if (!args[0].second.isEmpty()) + node->setDeprecatedSince(args[0].second); } else if ((command == COMMAND_INQMLMODULE) || (command == COMMAND_INJSMODULE)) { qdb->addToQmlModule(args[0].first, node); } else if (command == COMMAND_QMLINHERITS) { |