diff options
author | Topi Reinio <topi.reinio@qt.io> | 2020-02-14 11:14:27 +0100 |
---|---|---|
committer | Topi Reinio <topi.reinio@qt.io> | 2020-03-06 10:40:11 +0100 |
commit | fffed819ca8efeee79698aae07b27741f004f7e2 (patch) | |
tree | 4ef0dc1840dc3e18bb0f2f969dfefbc77c5ae6cf /tests/auto/qdoc/generatedoutput | |
parent | dc8598ab1e441d9b49a3aac1e3812bf93f8a3211 (diff) |
qdoc: Refactor automatic note generation for function nodes
Function nodes may have a number of automatically generated notes
added to the documentation; as they share the same formatting,
collect them into a single virtual function in Generator, and
override it in DocBookGenerator.
Call the virtual function in Generator::generateBody() after
generating the text for the Doc instance. As we append the
notes to the body, the order in which the notes appear
may change slightly (if a function comment generates multiple
notes).
Add \note commands in the tests in preparation for a follow-up
commit that utilizes the refactored code.
Task-number: QTBUG-37355
Change-Id: Id92926e53b61e03a2d2feceda70987191b708975
Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io>
Diffstat (limited to 'tests/auto/qdoc/generatedoutput')
3 files changed, 12 insertions, 0 deletions
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/docbook/qml-qdoc-test-type.xml b/tests/auto/qdoc/generatedoutput/expected_output/docbook/qml-qdoc-test-type.xml index 1ab15056a..59ed97a01 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/docbook/qml-qdoc-test-type.xml +++ b/tests/auto/qdoc/generatedoutput/expected_output/docbook/qml-qdoc-test-type.xml @@ -135,6 +135,9 @@ <db:section xml:id="completed-signal"> <db:title>completed(<db:emphasis>status</db:emphasis>)</db:title> <db:para>This signal is emitted when the operation completed with <db:code role="parameter">status</db:code>.</db:para> +<db:note> +<db:para>The corresponding handler is <db:code>onCompleted</db:code>.</db:para> +</db:note> </db:section> </db:section> <db:section xml:id="attached-signal-documentation"> @@ -142,6 +145,9 @@ <db:section xml:id="configured-signal"> <db:title>configured()</db:title> <db:para>This attached signal is emitted when the type was configured.</db:para> +<db:note> +<db:para>The corresponding handler is <db:code>onConfigured</db:code>.</db:para> +</db:note> </db:section> </db:section> <db:section xml:id="method-documentation"> diff --git a/tests/auto/qdoc/generatedoutput/expected_output/qml-qdoc-test-type.html b/tests/auto/qdoc/generatedoutput/expected_output/qml-qdoc-test-type.html index 166cbee81..f18e97082 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/qml-qdoc-test-type.html +++ b/tests/auto/qdoc/generatedoutput/expected_output/qml-qdoc-test-type.html @@ -143,6 +143,7 @@ <a name="completed-signal"></a><span class="name">completed</span>(<i>status</i>)</p></td></tr> </table></div></div> <div class="qmldoc"><p>This signal is emitted when the operation completed with <i>status</i>.</p> +<p><b>Note: </b>The corresponding handler is <code>onCompleted</code>.</p> </div></div><!-- @@@completed --> <br/> <h2>Attached Signal Documentation</h2> @@ -154,6 +155,7 @@ <a name="configured-signal"></a><span class="name">configured</span>()</p></td></tr> </table></div></div> <div class="qmldoc"><p>This attached signal is emitted when the type was configured.</p> +<p><b>Note: </b>The corresponding handler is <code>onConfigured</code>.</p> </div></div><!-- @@@configured --> <br/> <h2>Method Documentation</h2> diff --git a/tests/auto/qdoc/generatedoutput/testdata/qml/type.cpp b/tests/auto/qdoc/generatedoutput/testdata/qml/type.cpp index bf04bdb43..10a310a87 100644 --- a/tests/auto/qdoc/generatedoutput/testdata/qml/type.cpp +++ b/tests/auto/qdoc/generatedoutput/testdata/qml/type.cpp @@ -92,10 +92,14 @@ \qmlsignal Type::completed(int status) This signal is emitted when the operation completed with \a status. + + \note The corresponding handler is \c onCompleted. */ /*! \qmlattachedsignal Type::configured() This attached signal is emitted when the type was configured. + + \note The corresponding handler is \c onConfigured. */ |