From 58902fbd684d39191fbddf3ef5e917e709b38a68 Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Sat, 6 Jun 2020 12:30:22 +0200 Subject: qdoc: Extend synopsis for detailed reference sections MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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ƶ --- src/qdoc/cppcodeparser.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/qdoc/cppcodeparser.cpp') 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); -- cgit v1.2.1