summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorTopi Reinio <topi.reinio@qt.io>2020-07-27 13:39:36 +0200
committerTopi Reinio <topi.reinio@qt.io>2020-08-07 12:49:24 +0200
commit98cca5ff823fe2d4e41f45173e0675bcdf9e2542 (patch)
treed0da68d2131d6cdb811bbe4c333fab187c51a4f6 /tests
parentb0be77c9c58fab9a164126fb35b4b3999a42e089 (diff)
qdoc: Correctly handle default values for \qmlmethod parameters
The QML parser in QDoc was already able to parse default parameter values listed for \qmlmethod in a .qml file, but they were not handled when the command appeared in a .cpp or .qdoc file as a different code path is used for those. Pick-to: 5.15 Fixes: QTBUG-85756 Change-Id: I671a19b66f82e1a6cd81b8bb487dffa2133ee65d Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/docbook/qml-qdoc-test-abstractparent.xml2
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/docbook/qml-qdoc-test-child.xml2
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/qml-qdoc-test-abstractparent.html4
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/qml-qdoc-test-child.html4
-rw-r--r--tests/auto/qdoc/generatedoutput/testdata/qml/parent.qdoc2
5 files changed, 7 insertions, 7 deletions
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/docbook/qml-qdoc-test-abstractparent.xml b/tests/auto/qdoc/generatedoutput/expected_output/docbook/qml-qdoc-test-abstractparent.xml
index 479b70685..ceac4f33f 100644
--- a/tests/auto/qdoc/generatedoutput/expected_output/docbook/qml-qdoc-test-abstractparent.xml
+++ b/tests/auto/qdoc/generatedoutput/expected_output/docbook/qml-qdoc-test-abstractparent.xml
@@ -46,7 +46,7 @@
<db:section xml:id="method-documentation">
<db:title>Method Documentation</db:title>
<db:section xml:id="rear-method">
-<db:title>void rear(Child <db:emphasis>child</db:emphasis>, var <db:emphasis>method</db:emphasis>)</db:title>
+<db:title>void rear(Child <db:emphasis>child</db:emphasis>, var <db:emphasis>method</db:emphasis> = Strict)</db:title>
<db:para>Do some abstract parenting on <db:code role="parameter">child</db:code> using a specific <db:code role="parameter">method</db:code>.</db:para>
</db:section>
</db:section>
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/docbook/qml-qdoc-test-child.xml b/tests/auto/qdoc/generatedoutput/expected_output/docbook/qml-qdoc-test-child.xml
index 657c54d0d..21b3fbc05 100644
--- a/tests/auto/qdoc/generatedoutput/expected_output/docbook/qml-qdoc-test-child.xml
+++ b/tests/auto/qdoc/generatedoutput/expected_output/docbook/qml-qdoc-test-child.xml
@@ -46,7 +46,7 @@
<db:section xml:id="method-documentation">
<db:title>Method Documentation</db:title>
<db:section xml:id="rear-method">
-<db:title>void rear(Child <db:emphasis>child</db:emphasis>, var <db:emphasis>method</db:emphasis>)</db:title>
+<db:title>void rear(Child <db:emphasis>child</db:emphasis>, var <db:emphasis>method</db:emphasis> = Strict)</db:title>
<db:para>Do some abstract parenting on <db:code role="parameter">child</db:code> using a specific <db:code role="parameter">method</db:code>.</db:para>
</db:section>
</db:section>
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/qml-qdoc-test-abstractparent.html b/tests/auto/qdoc/generatedoutput/expected_output/qml-qdoc-test-abstractparent.html
index 4bdc1261f..e23993eb9 100644
--- a/tests/auto/qdoc/generatedoutput/expected_output/qml-qdoc-test-abstractparent.html
+++ b/tests/auto/qdoc/generatedoutput/expected_output/qml-qdoc-test-abstractparent.html
@@ -34,7 +34,7 @@
<a name="methods"></a>
<h2 id="methods">Methods</h2>
<ul>
-<li class="fn">void <b><b><a href="qml-qdoc-test-abstractparent.html#rear-method">rear</a></b></b>(Child <i>child</i>, var <i>method</i>)</li>
+<li class="fn">void <b><b><a href="qml-qdoc-test-abstractparent.html#rear-method">rear</a></b></b>(Child <i>child</i>, var <i>method</i>)</li>
</ul>
<!-- $$$AbstractParent-description -->
<a name="details"></a>
@@ -57,7 +57,7 @@
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="rear-method">
<td class="tblQmlFuncNode"><p>
-<a name="rear-method"></a><span class="type">void</span> <span class="name">rear</span>(<span class="type"><a href="qml-qdoc-test-child.html">Child</a></span> <i>child</i>, <span class="type">var</span> <i>method</i>)</p></td></tr>
+<a name="rear-method"></a><span class="type">void</span> <span class="name">rear</span>(<span class="type"><a href="qml-qdoc-test-child.html">Child</a></span> <i>child</i>, <span class="type">var</span> <i>method</i> = Strict)</p></td></tr>
</table></div></div>
<div class="qmldoc"><p>Do some abstract parenting on <i>child</i> using a specific <i>method</i>.</p>
</div></div><!-- @@@rear -->
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/qml-qdoc-test-child.html b/tests/auto/qdoc/generatedoutput/expected_output/qml-qdoc-test-child.html
index 0cfbe1bec..df0a15b86 100644
--- a/tests/auto/qdoc/generatedoutput/expected_output/qml-qdoc-test-child.html
+++ b/tests/auto/qdoc/generatedoutput/expected_output/qml-qdoc-test-child.html
@@ -34,7 +34,7 @@
<a name="methods"></a>
<h2 id="methods">Methods</h2>
<ul>
-<li class="fn">void <b><b><a href="qml-qdoc-test-child.html#rear-method">rear</a></b></b>(Child <i>child</i>, var <i>method</i>)</li>
+<li class="fn">void <b><b><a href="qml-qdoc-test-child.html#rear-method">rear</a></b></b>(Child <i>child</i>, var <i>method</i>)</li>
</ul>
<!-- $$$Child-description -->
<a name="details"></a>
@@ -57,7 +57,7 @@
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="rear-method">
<td class="tblQmlFuncNode"><p>
-<a name="rear-method"></a><span class="type">void</span> <span class="name">rear</span>(<span class="type"><a href="qml-qdoc-test-child.html">Child</a></span> <i>child</i>, <span class="type">var</span> <i>method</i>)</p></td></tr>
+<a name="rear-method"></a><span class="type">void</span> <span class="name">rear</span>(<span class="type"><a href="qml-qdoc-test-child.html">Child</a></span> <i>child</i>, <span class="type">var</span> <i>method</i> = Strict)</p></td></tr>
</table></div></div>
<div class="qmldoc"><p>Do some abstract parenting on <i>child</i> using a specific <i>method</i>.</p>
</div></div><!-- @@@rear -->
diff --git a/tests/auto/qdoc/generatedoutput/testdata/qml/parent.qdoc b/tests/auto/qdoc/generatedoutput/testdata/qml/parent.qdoc
index b52f125e8..c3db549eb 100644
--- a/tests/auto/qdoc/generatedoutput/testdata/qml/parent.qdoc
+++ b/tests/auto/qdoc/generatedoutput/testdata/qml/parent.qdoc
@@ -40,7 +40,7 @@
*/
/*!
- \qmlmethod void AbstractParent::rear(Child child, var method)
+ \qmlmethod void AbstractParent::rear(Child child, var method = Strict)
\brief Do some abstract parenting on \a child using a specific \a method.
*/