summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorTopi Reinio <topi.reinio@qt.io>2020-10-20 15:06:43 +0200
committerTopi Reinio <topi.reinio@qt.io>2020-10-20 17:22:59 +0200
commit1c4ca3b8d08ea15dd34a8aba0ec5052a1c471ff1 (patch)
tree5df4ca14742efb76da432768260f650cc7d268e4 /tests
parent57e18911d0af62f7cdec8833cf064ecb9d7ed92c (diff)
qdoc: Fix parsing of private signals
Parameters with a type QPrivateSignal were already removed when constructing a FunctionNode from header declaration. This was erraneously subtracted from the number of stored parameters when parsing an \fn command. Fixes: QTBUG-87731 Change-Id: I01409c0fcdab0dfbf8a0b9d22cded99618bdcc2d Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/properties-docbook/testqdoc-testderived.xml17
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/properties/testcpp.index1
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/properties/testqdoc-testderived-members.html1
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/properties/testqdoc-testderived.html6
-rw-r--r--tests/auto/qdoc/generatedoutput/testdata/testcpp/testcpp.cpp9
-rw-r--r--tests/auto/qdoc/generatedoutput/testdata/testcpp/testcpp.h1
6 files changed, 35 insertions, 0 deletions
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/properties-docbook/testqdoc-testderived.xml b/tests/auto/qdoc/generatedoutput/expected_output/properties-docbook/testqdoc-testderived.xml
index 7acf1c95a..fd9eeace9 100644
--- a/tests/auto/qdoc/generatedoutput/expected_output/properties-docbook/testqdoc-testderived.xml
+++ b/tests/auto/qdoc/generatedoutput/expected_output/properties-docbook/testqdoc-testderived.xml
@@ -165,6 +165,23 @@
</db:section>
<db:section xml:id="member-function-documentation">
<db:title>Member Function Documentation</db:title>
+<db:section xml:id="emitSomething">
+<db:title>[signal] TestDerived::void emitSomething()</db:title>
+<db:methodsynopsis>
+<db:void/>
+<db:methodname>emitSomething</db:methodname>
+<db:void/>
+<db:synopsisinfo db:role="meta">signal</db:synopsisinfo>
+<db:synopsisinfo db:role="signature">void emitSomething()</db:synopsisinfo>
+<db:synopsisinfo db:role="access">public</db:synopsisinfo>
+<db:synopsisinfo db:role="status">active</db:synopsisinfo>
+<db:synopsisinfo db:role="threadsafeness">unspecified</db:synopsisinfo>
+<db:synopsisinfo db:role="module">TestCPP</db:synopsisinfo>
+</db:methodsynopsis>
+<db:para>Emitted when things happen.</db:para>
+<db:note>
+<db:para>This is a private signal. It can be used in signal connections but cannot be emitted by the user.</db:para></db:note>
+</db:section>
<db:section xml:id="virtualFun">
<db:title>[override virtual] TestDerived::void virtualFun()</db:title>
<db:methodsynopsis>
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/properties/testcpp.index b/tests/auto/qdoc/generatedoutput/expected_output/properties/testcpp.index
index 8d8d7837b..35606d35d 100644
--- a/tests/auto/qdoc/generatedoutput/expected_output/properties/testcpp.index
+++ b/tests/auto/qdoc/generatedoutput/expected_output/properties/testcpp.index
@@ -52,6 +52,7 @@
<function name="bindablePropChanged" fullname="TestQDoc::TestDerived::bindablePropChanged" href="testqdoc-testderived.html#bindableProp-prop" status="active" access="public" location="testcpp.h" meta="signal" virtual="non" const="false" static="false" final="false" override="false" associated-property="bindableProp" type="void" signature="void bindablePropChanged()"/>
<function name="boolProp" fullname="TestQDoc::TestDerived::boolProp" href="testqdoc-testderived.html#boolProp-prop" status="active" access="public" location="testcpp.h" meta="plain" virtual="non" const="false" static="false" final="false" override="false" associated-property="boolProp" type="bool" signature="bool boolProp()"/>
<function name="boolPropChanged" fullname="TestQDoc::TestDerived::boolPropChanged" href="testqdoc-testderived.html#boolProp-prop" status="active" access="public" location="testcpp.h" meta="signal" virtual="non" const="false" static="false" final="false" override="false" associated-property="boolProp" type="void" signature="void boolPropChanged()"/>
+ <function name="emitSomething" fullname="TestQDoc::TestDerived::emitSomething" href="testqdoc-testderived.html#emitSomething" status="active" access="public" location="testcpp.h" documented="true" meta="signal" virtual="non" const="false" static="false" final="false" override="false" type="void" signature="void emitSomething()"/>
<function name="getInt" fullname="TestQDoc::TestDerived::getInt" href="testqdoc-testderived.html#intProp-prop" status="active" access="public" location="testcpp.h" meta="plain" virtual="non" const="false" static="false" final="false" override="false" associated-property="intProp" type="int *" signature="int * getInt()"/>
<function name="metaObject" fullname="TestQDoc::TestDerived::metaObject" href="testqdoc-testderived.html#metaObject" status="internal" access="private" location="testcpp.h" meta="plain" virtual="virtual" const="true" static="false" final="false" override="false" type="const QMetaObject *" signature="const QMetaObject * metaObject() const"/>
<function name="qt_metacall" fullname="TestQDoc::TestDerived::qt_metacall" href="testqdoc-testderived.html#qt_metacall" status="internal" access="private" location="testcpp.h" meta="plain" virtual="virtual" const="false" static="false" final="false" override="false" type="int" signature="int qt_metacall(QMetaObject::Call , int , void **)">
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/properties/testqdoc-testderived-members.html b/tests/auto/qdoc/generatedoutput/expected_output/properties/testqdoc-testderived-members.html
index 452399c69..9fed1358e 100644
--- a/tests/auto/qdoc/generatedoutput/expected_output/properties/testqdoc-testderived-members.html
+++ b/tests/auto/qdoc/generatedoutput/expected_output/properties/testqdoc-testderived-members.html
@@ -17,6 +17,7 @@
<li class="fn">typedef <span class="name"><b><a href="testqdoc-test.html#SomeType-typedef">SomeType</a></b></span></li>
<li class="fn"><span class="name"><b><a href="testqdoc-testderived.html#bindableProp-prop">bindablePropChanged</a></b></span>()</li>
<li class="fn"><span class="name"><b><a href="testqdoc-testderived.html#boolProp-prop">boolPropChanged</a></b></span>()</li>
+<li class="fn"><span class="name"><b><a href="testqdoc-testderived.html#emitSomething">emitSomething</a></b></span>()</li>
<li class="fn"><span class="name"><b><a href="testqdoc-test.html#operator-eq">operator=</a></b></span>(TestQDoc::Test &amp;&amp;) : TestQDoc::Test &amp;</li>
<li class="fn"><span class="name"><b><a href="testqdoc-testderived.html#boolProp-prop">resetBoolProp</a></b></span>()</li>
<li class="fn"><span class="name"><b><a href="testqdoc-testderived.html#bindableProp-prop">setBindableProp</a></b></span>(const QString &amp;)</li>
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/properties/testqdoc-testderived.html b/tests/auto/qdoc/generatedoutput/expected_output/properties/testqdoc-testderived.html
index 6546f5ba3..d2e10db59 100644
--- a/tests/auto/qdoc/generatedoutput/expected_output/properties/testqdoc-testderived.html
+++ b/tests/auto/qdoc/generatedoutput/expected_output/properties/testqdoc-testderived.html
@@ -71,6 +71,7 @@ target_link_libraries(mytarget PUBLIC Qt::QDocTest)</td></tr><tr><td class="memI
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="testqdoc-testderived.html#bindableProp-prop">bindablePropChanged</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="testqdoc-testderived.html#boolProp-prop">boolPropChanged</a></b>()</td></tr>
+<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="testqdoc-testderived.html#emitSomething">emitSomething</a></b>()</td></tr>
</table></div>
<a name="details"></a>
<!-- $$$TestDerived-description -->
@@ -128,6 +129,11 @@ target_link_libraries(mytarget PUBLIC Qt::QDocTest)</td></tr><tr><td class="memI
</div>
<div class="func">
<h2>Member Function Documentation</h2>
+<!-- $$$emitSomething[overload1]$$$emitSomething -->
+<h3 class="fn" id="emitSomething"><a name="emitSomething"></a><code>[signal] </code><span class="type">void</span> TestDerived::<span class="name">emitSomething</span>()</h3>
+<p>Emitted when things happen.</p>
+<p><b>Note: </b>This is a private signal. It can be used in signal connections but cannot be emitted by the user.</p>
+<!-- @@@emitSomething -->
<!-- $$$virtualFun[overload1]$$$virtualFun -->
<h3 class="fn" id="virtualFun"><a name="virtualFun"></a><code>[override virtual] </code><span class="type">void</span> TestDerived::<span class="name">virtualFun</span>()</h3>
<p>Reimplements: <a href="testqdoc-test.html#virtualFun">Test::virtualFun</a>().</p>
diff --git a/tests/auto/qdoc/generatedoutput/testdata/testcpp/testcpp.cpp b/tests/auto/qdoc/generatedoutput/testdata/testcpp/testcpp.cpp
index f38e4a367..66c4adba3 100644
--- a/tests/auto/qdoc/generatedoutput/testdata/testcpp/testcpp.cpp
+++ b/tests/auto/qdoc/generatedoutput/testdata/testcpp/testcpp.cpp
@@ -225,6 +225,15 @@ void TestDerived::virtualFun()
*/
/*!
+\if defined(test_properties)
+ \fn void TestDerived::emitSomething()
+ Emitted when things happen.
+\else
+ \nothing
+\endif
+*/
+
+/*!
\if defined(test_template)
\fn template <typename T1, typename T2> void TestQDoc::Test::funcTemplate(T1 a, T2 b)
\brief Function template with two parameters, \a a and \a b.
diff --git a/tests/auto/qdoc/generatedoutput/testdata/testcpp/testcpp.h b/tests/auto/qdoc/generatedoutput/testdata/testcpp/testcpp.h
index 4b6d23a17..1be6082c9 100644
--- a/tests/auto/qdoc/generatedoutput/testdata/testcpp/testcpp.h
+++ b/tests/auto/qdoc/generatedoutput/testdata/testcpp/testcpp.h
@@ -105,6 +105,7 @@ public:
bool boolProp();
Q_SIGNALS:
+ void emitSomething(QPrivateSignal);
void bindablePropChanged();
Q_REVISION(1) void boolPropChanged();