diff options
author | Topi Reinio <topi.reinio@qt.io> | 2020-06-06 12:30:22 +0200 |
---|---|---|
committer | Topi Reinio <topi.reinio@qt.io> | 2020-06-08 16:31:16 +0200 |
commit | 58902fbd684d39191fbddf3ef5e917e709b38a68 (patch) | |
tree | 930157c38ec390ad164bea408057a999b4ae73fc /src/qdoc/cppcodeparser.cpp | |
parent | 41c601103dd2fef14e59a120e142008f8e3e93cd (diff) | |
download | qttools-58902fbd684d39191fbddf3ef5e917e709b38a68.tar.gz |
qdoc: Extend synopsis for detailed reference sections
Include \since information for detailed synopsis generation,
and allow duplication of qdoc comments for C++/QML nodes
on the condition that the extra comments contain no
body text, only meta-commands.
The use case is to have full status information in the
signature/section title, and allow additional meta-commands
for items that share a documentation comment.
/*!
\fn void A:foo()
\fn void A:foo(int i)
Shared documentation for overloads.
*/
/*!
\fn void A:foo(int i)
\since 2.0
*/
Extract the code for 'extra' synopsis into a new helper function
and use for both HTML and DocBook generators.
Fixes: QTBUG-55739
Fixes: QTBUG-82902
Change-Id: I6e797d3ce7bc7b02102bb949515f88e7a0fbe929
Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io>
Diffstat (limited to 'src/qdoc/cppcodeparser.cpp')
-rw-r--r-- | src/qdoc/cppcodeparser.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/qdoc/cppcodeparser.cpp b/src/qdoc/cppcodeparser.cpp index 5f7d0d4bc..85d3259bf 100644 --- a/src/qdoc/cppcodeparser.cpp +++ b/src/qdoc/cppcodeparser.cpp @@ -427,10 +427,14 @@ void CppCodeParser::processQmlProperties(const Doc &doc, NodeList &nodes, DocLis .arg(arg)); continue; } - if (qmlType->hasQmlProperty(property, attached) != nullptr) { - doc.startLocation().warning( - QStringLiteral("QML property documented multiple times: '%1'") - .arg(arg)); + QmlPropertyNode *existingProperty = qmlType->hasQmlProperty(property, attached); + if (existingProperty) { + processMetaCommands(doc, existingProperty); + if (!doc.body().isEmpty()) { + doc.startLocation().warning( + QStringLiteral("QML property documented multiple times: '%1'") + .arg(arg)); + } continue; } auto *qpn = new QmlPropertyNode(qmlType, property, type, attached); |