summaryrefslogtreecommitdiff
path: root/src/qdoc/generator.cpp
diff options
context:
space:
mode:
authorTopi Reinio <topi.reinio@qt.io>2020-02-14 11:36:16 +0100
committerTopi Reinio <topi.reinio@qt.io>2020-03-06 12:29:17 +0100
commite18472fdd03a1a0633aa153ba8e579be4869fcf3 (patch)
treecac40e36d21df3556e757f55e410585d4d845815 /src/qdoc/generator.cpp
parentfffed819ca8efeee79698aae07b27741f004f7e2 (diff)
downloadqttools-e18472fdd03a1a0633aa153ba8e579be4869fcf3.tar.gz
qdoc: Add an auto-generated note in \qmlsignal documentation
Construct the signal handler name and generate a note for it. This eliminates the need to maintain such notes in the source. Remove the hard-coded notes from the test source (but not from the expected output data). [ChangeLog][qdoc] QDoc now generates a note for the name of the corresponding handler in \qmlsignal documentation. Task-number: QTBUG-37355 Change-Id: Ia3ab98be909a41bde619224c9a616cb8704e258a Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Diffstat (limited to 'src/qdoc/generator.cpp')
-rw-r--r--src/qdoc/generator.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/qdoc/generator.cpp b/src/qdoc/generator.cpp
index f8fb9ad02..abf0602df 100644
--- a/src/qdoc/generator.cpp
+++ b/src/qdoc/generator.cpp
@@ -829,6 +829,8 @@ void Generator::generateBody(const Node *node, CodeMarker *marker)
}
if (fn) {
+ if (fn->isQmlSignal())
+ generateAddendum(node, QmlSignalHandler, marker);
if (fn->isPrivateSignal())
generateAddendum(node, PrivateSignal, marker);
if (fn->isInvokable())
@@ -1373,6 +1375,16 @@ void Generator::generateAddendum(const Node *node, Addendum type, CodeMarker *ma
text << "This is a private signal. It can be used in signal connections "
"but cannot be emitted by the user.";
break;
+ case QmlSignalHandler:
+ {
+ QString handler(node->name());
+ handler[0] = handler[0].toTitleCase();
+ handler.prepend(QLatin1String("on"));
+ text << "The corresponding handler is "
+ << Atom(Atom::FormattingLeft, ATOM_FORMATTING_TELETYPE) << handler
+ << Atom(Atom::FormattingRight, ATOM_FORMATTING_TELETYPE) << ".";
+ break;
+ }
case AssociatedProperties:
{
if (!node->isFunction())