diff options
author | Topi Reinio <topi.reinio@qt.io> | 2020-06-06 22:26:50 +0200 |
---|---|---|
committer | Topi Reinio <topi.reinio@qt.io> | 2020-06-08 16:31:10 +0200 |
commit | 41c601103dd2fef14e59a120e142008f8e3e93cd (patch) | |
tree | 7480a101732388763ba86d309de9a8a13f424a51 /tests | |
parent | 9d9fb9e45d5e30c253b15b565f822a9641488eae (diff) |
qdoc: Fix output for abstract internal QML base types
Abstract QML types propagate their members to the documentation of
the inheriting types; however, this did not happen if the abstract
type was marked \internal. Fix this as it's contrary to how
\qmlabstract is documented.
Fix related issues:
- Skip abstract internal bases from .qhp selectors (as they produced
broken links)
- Skip them also in DocBook generator's \annotatedlist implementation
- Remove unused/duplicated code for QML base types
Fixes: QTBUG-82137
Change-Id: Ic3f2e71bdf30070fb0005333e51052697046e1bc
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Diffstat (limited to 'tests')
7 files changed, 122 insertions, 1 deletions
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/docbook/qdoc-test-qmlmodule.xml b/tests/auto/qdoc/generatedoutput/expected_output/docbook/qdoc-test-qmlmodule.xml index dfe6c3b6e..8d514bad1 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/docbook/qdoc-test-qmlmodule.xml +++ b/tests/auto/qdoc/generatedoutput/expected_output/docbook/qdoc-test-qmlmodule.xml @@ -39,6 +39,12 @@ </db:listitem> </db:varlistentry> <db:varlistentry> +<db:term><db:link xlink:href="qml-qdoc-test-yetanotherchild.xml" xlink:role="">YetAnotherChild</db:link></db:term> +<db:listitem> +<db:para>A type inheriting from internal abstract parent.</db:para> +</db:listitem> +</db:varlistentry> +<db:varlistentry> <db:term><db:link xlink:href="qml-qdoc-test-type.xml" xlink:role="">Type</db:link></db:term> <db:listitem> <db:para>A QML type documented in a .cpp file.</db:para> diff --git a/tests/auto/qdoc/generatedoutput/expected_output/docbook/qml-qdoc-test-yetanotherchild.xml b/tests/auto/qdoc/generatedoutput/expected_output/docbook/qml-qdoc-test-yetanotherchild.xml new file mode 100644 index 000000000..487043376 --- /dev/null +++ b/tests/auto/qdoc/generatedoutput/expected_output/docbook/qml-qdoc-test-yetanotherchild.xml @@ -0,0 +1,38 @@ +<?xml version="1.0" encoding="UTF-8"?> +<db:article xmlns:db="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" version="5.2" xml:lang="en"> +<db:info> +<db:title>YetAnotherChild QML Type</db:title> +<db:productname>Test</db:productname> +<db:titleabbrev>A test project for QDoc build artifacts</db:titleabbrev> +<db:abstract> +<db:para>A type inheriting from internal abstract parent.</db:para> +</db:abstract> +</db:info> +<db:variablelist> +<db:varlistentry> +<db:term>Import Statement</db:term> +<db:listitem> +<db:para>import QDoc.Test 1.1</db:para> +</db:listitem> +</db:varlistentry> +</db:variablelist> +<db:section xml:id="details"> +<db:title>Detailed Description</db:title> +</db:section> +<db:section xml:id="property-documentation"> +<db:title>Property Documentation</db:title> +<db:section xml:id="prop-prop"> +<db:title>prop : int</db:title> +<db:fieldsynopsis> +<db:type>int</db:type> +<db:varname>prop</db:varname> +<db:modifier>writable</db:modifier> +<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">Test</db:synopsisinfo> +</db:fieldsynopsis> +<db:para>Propagated to inheriting type docs.</db:para> +</db:section> +</db:section> +</db:article> diff --git a/tests/auto/qdoc/generatedoutput/expected_output/qdoc-test-qmlmodule.html b/tests/auto/qdoc/generatedoutput/expected_output/qdoc-test-qmlmodule.html index 734447216..16df6ff0d 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/qdoc-test-qmlmodule.html +++ b/tests/auto/qdoc/generatedoutput/expected_output/qdoc-test-qmlmodule.html @@ -19,7 +19,8 @@ <tr class="even topAlign"><td class="tblName"><p><a href="qml-qdoc-test-child.html">Child</a></p></td><td class="tblDescr"><p>A Child inheriting its parent</p></td></tr> <tr class="odd topAlign"><td class="tblName"><p><a href="qml-qdoc-test-doctest.html">DocTest</a></p></td><td class="tblDescr"><p>Represents a doc test case</p></td></tr> <tr class="even topAlign"><td class="tblName"><p><a href="qml-qdoc-test-type.html">Type</a></p></td><td class="tblDescr"><p>A QML type documented in a .cpp file</p></td></tr> -<tr class="odd topAlign"><td class="tblName"><p><a href="qml-int.html">int</a></p></td><td class="tblDescr"><p>An integer basic type</p></td></tr> +<tr class="odd topAlign"><td class="tblName"><p><a href="qml-qdoc-test-yetanotherchild.html">YetAnotherChild</a></p></td><td class="tblDescr"><p>A type inheriting from internal abstract parent</p></td></tr> +<tr class="even topAlign"><td class="tblName"><p><a href="qml-int.html">int</a></p></td><td class="tblDescr"><p>An integer basic type</p></td></tr> </table></div> </body> </html> diff --git a/tests/auto/qdoc/generatedoutput/expected_output/qml-qdoc-test-yetanotherchild.html b/tests/auto/qdoc/generatedoutput/expected_output/qml-qdoc-test-yetanotherchild.html new file mode 100644 index 000000000..a79c759af --- /dev/null +++ b/tests/auto/qdoc/generatedoutput/expected_output/qml-qdoc-test-yetanotherchild.html @@ -0,0 +1,48 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="utf-8"> +<!-- parent.qdoc --> + <title>YetAnotherChild QML Type | Test</title> +</head> +<body> +<div class="sidebar"> +<div class="toc"> +<h3><a name="toc">Contents</a></h3> +<ul> +<li class="level1"><a href="#properties">Properties</a></li> +<li class="level1"><a href="#details">Detailed Description</a></li> +</ul> +</div> +<div class="sidebar-content" id="sidebar-content"></div></div> +<h1 class="title">YetAnotherChild QML Type</h1> +<span class="subtitle"></span> +<!-- $$$YetAnotherChild-brief --> +<p>A type inheriting from internal abstract parent. <a href="#details">More...</a></p> +<!-- @@@YetAnotherChild --> +<div class="table"><table class="alignedsummary"> +<tr><td class="memItemLeft rightAlign topAlign"> Import Statement:</td><td class="memItemRight bottomAlign"> import QDoc.Test 1.1</td></tr></table></div><ul> +<li><a href="qml-qdoc-test-yetanotherchild-members.html">List of all members, including inherited members</a></li> +</ul> +<a name="properties"></a> +<h2 id="properties">Properties</h2> +<ul> +<li class="fn"><b><b><a href="qml-qdoc-test-yetanotherchild.html#prop-prop">prop</a></b></b> : int</li> +</ul> +<!-- $$$YetAnotherChild-description --> +<a name="details"></a> +<h2 id="details">Detailed Description</h2> +<!-- @@@YetAnotherChild --> +<h2>Property Documentation</h2> +<!-- $$$prop --> +<div class="qmlitem"><div class="qmlproto"> +<div class="table"><table class="qmlname"> +<tr valign="top" class="odd" id="prop-prop"> +<td class="tblQmlPropNode"><p> +<a name="prop-prop"></a><span class="name">prop</span> : <span class="type"><a href="qml-int.html">int</a></span></p></td></tr> +</table></div></div> +<div class="qmldoc"><p>Propagated to inheriting type docs.</p> +</div></div><!-- @@@prop --> +<br/> +</body> +</html> diff --git a/tests/auto/qdoc/generatedoutput/expected_output/test.qhp b/tests/auto/qdoc/generatedoutput/expected_output/test.qhp index 3f3a78968..b2aa939bf 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/test.qhp +++ b/tests/auto/qdoc/generatedoutput/expected_output/test.qhp @@ -37,6 +37,9 @@ <section ref="qml-qdoc-test-type.html" title="Type Type Reference"> <section ref="qml-qdoc-test-type-members.html" title="List of all members"/> </section> + <section ref="qml-qdoc-test-yetanotherchild.html" title="YetAnotherChild Type Reference"> + <section ref="qml-qdoc-test-yetanotherchild-members.html" title="List of all members"/> + </section> <section ref="qml-uicomponents-progressbar.html" title="ProgressBar Type Reference"> <section ref="qml-uicomponents-progressbar-members.html" title="List of all members"/> </section> @@ -68,6 +71,7 @@ <keyword name="TestQDoc" id="TestQDoc" ref="testqdoc.html"/> <keyword name="Type" id="QML.Type" ref="qml-qdoc-test-type.html"/> <keyword name="UI Components" id="UI Components" ref="uicomponents-qmlmodule.html"/> + <keyword name="YetAnotherChild" id="QML.YetAnotherChild" ref="qml-qdoc-test-yetanotherchild.html"/> <keyword name="abs" id="int::abs" ref="qml-int.html#abs-method"/> <keyword name="active" id="DocTest::active" ref="qml-qdoc-test-doctest.html#active-prop"/> <keyword name="anotherObsoleteMember" id="Test::anotherObsoleteMember" ref="testqdoc-test-obsolete.html#anotherObsoleteMember"/> @@ -121,6 +125,8 @@ <file>qml-qdoc-test-doctest.html</file> <file>qml-qdoc-test-type-members.html</file> <file>qml-qdoc-test-type.html</file> + <file>qml-qdoc-test-yetanotherchild-members.html</file> + <file>qml-qdoc-test-yetanotherchild.html</file> <file>qml-uicomponents-progressbar-members.html</file> <file>qml-uicomponents-progressbar.html</file> <file>qml-uicomponents-switch-members.html</file> diff --git a/tests/auto/qdoc/generatedoutput/testdata/qml/parent.qdoc b/tests/auto/qdoc/generatedoutput/testdata/qml/parent.qdoc index a2842f0d6..b52f125e8 100644 --- a/tests/auto/qdoc/generatedoutput/testdata/qml/parent.qdoc +++ b/tests/auto/qdoc/generatedoutput/testdata/qml/parent.qdoc @@ -62,3 +62,23 @@ \qmlmethod int int::abs() Returns the absolute value of this integer. */ + +/*! + \qmltype InternParent + \inqmlmodule QDoc.Test + \internal + \qmlabstract + \brief Internal abstract base QML type. +*/ + +/*! + \qmlproperty int InternParent::prop + \brief Propagated to inheriting type docs. +*/ + +/*! + \qmltype YetAnotherChild + \inherits InternParent + \inqmlmodule QDoc.Test + \brief A type inheriting from internal abstract parent. +*/ diff --git a/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp b/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp index dc925b870..94850ba63 100644 --- a/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp +++ b/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp @@ -234,6 +234,7 @@ void tst_generatedOutput::htmlFromQml() "qdoc-test-qmlmodule.html " "qml-qdoc-test-abstractparent.html " "qml-qdoc-test-child.html " + "qml-qdoc-test-yetanotherchild.html " "qml-qdoc-test-doctest.html " "qml-qdoc-test-type-members.html " "qml-qdoc-test-type.html " @@ -307,6 +308,7 @@ void tst_generatedOutput::docBookFromQml() "docbook/qdoc-test-qmlmodule.xml " "docbook/qml-qdoc-test-abstractparent.xml " "docbook/qml-qdoc-test-child.xml " + "docbook/qml-qdoc-test-yetanotherchild.xml " "docbook/qml-qdoc-test-doctest.xml " "docbook/qml-qdoc-test-type.xml " "docbook/qml-uicomponents-progressbar.xml " |