diff options
author | Topi Reinio <topi.reinio@qt.io> | 2020-02-11 11:23:18 +0100 |
---|---|---|
committer | Topi Reiniƶ <topi.reinio@qt.io> | 2020-02-12 09:23:59 +0000 |
commit | 559332dc3efa507baaaba4ea8288bdb2318bc73d (patch) | |
tree | 7e57c4f1c00f8e5d8822867da5eea6ed78e8ce60 | |
parent | cd352d921fc2f523f8d83d387d51390305e71d89 (diff) |
qdoc: Fix regression in linking to QML properties in offline docs
The <a name="..."> elements used for anchors are obsolete, but it
turns out the QTextBrowser backend for offline documentation still
relies on them. Re-introduce them into the output.
This commit partially reverts 5aa19d92.
Fixes: QTBUG-82034
Change-Id: Ia4af9c2ed809b12c5f79d27db4dd3eb5e9523d13
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
8 files changed, 34 insertions, 32 deletions
diff --git a/src/qdoc/htmlgenerator.cpp b/src/qdoc/htmlgenerator.cpp index 8d6d5000f..fdfb4a65b 100644 --- a/src/qdoc/htmlgenerator.cpp +++ b/src/qdoc/htmlgenerator.cpp @@ -3625,7 +3625,7 @@ void HtmlGenerator::generateDetailedQmlMember(Node *node, const Aggregate *relat "<div class=\"table\"><table class=\"qmlname\">\n"); QString qmlItemStart("<tr valign=\"top\" class=\"odd\" id=\"%1\">\n" - "<td class=\"%2\"><p>\n"); + "<td class=\"%2\"><p>\n<a name=\"%1\"></a>"); QString qmlItemEnd("</p></td></tr>\n"); QString qmlItemFooter("</table></div></div>\n"); @@ -3656,8 +3656,10 @@ void HtmlGenerator::generateDetailedQmlMember(Node *node, const Aggregate *relat const SharedCommentNode *scn = static_cast<const SharedCommentNode *>(node); out() << qmlItemHeader; if (!scn->name().isEmpty()) { - out() << "<tr valign=\"top\" class=\"even\" id=\"" << refForNode(scn) << "\">"; + const QString nodeRef = refForNode(scn); + out() << "<tr valign=\"top\" class=\"even\" id=\"" << nodeRef << "\">"; out() << "<th class=\"centerAlign\"><p>"; + out() << "<a name=\"" + nodeRef + "\"></a>"; out() << "<b>" << scn->name() << " group</b>"; out() << "</p></th></tr>\n"; } 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 949dc7868..3668112ee 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 @@ -46,7 +46,7 @@ <div class="table"><table class="qmlname"> <tr valign="top" class="odd" id="children-prop"> <td class="tblQmlPropNode"><p> -<span class="qmldefault">[default] </span><span class="name">children</span> : <span class="type">list</span><<span class="type"><a href="qml-qdoc-test-child.html">Child</a></span>></p></td></tr> +<a name="children-prop"></a><span class="qmldefault">[default] </span><span class="name">children</span> : <span class="type">list</span><<span class="type"><a href="qml-qdoc-test-child.html">Child</a></span>></p></td></tr> </table></div></div> <div class="qmldoc"><p>Children of the type.</p> </div></div><!-- @@@children --> @@ -57,7 +57,7 @@ <div class="table"><table class="qmlname"> <tr valign="top" class="odd" id="rear-method"> <td class="tblQmlFuncNode"><p> -<span class="type">void</span> <span class="name">rear</span>(<i>child</i>)</p></td></tr> +<a name="rear-method"></a><span class="type">void</span> <span class="name">rear</span>(<i>child</i>)</p></td></tr> </table></div></div> <div class="qmldoc"><p>Do some abstract parenting on <i>child</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 5ba40c99c..22f38cc9c 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 @@ -46,7 +46,7 @@ <div class="table"><table class="qmlname"> <tr valign="top" class="odd" id="children-prop"> <td class="tblQmlPropNode"><p> -<span class="qmldefault">[default] </span><span class="name">children</span> : <span class="type">list</span><<span class="type"><a href="qml-qdoc-test-child.html">Child</a></span>></p></td></tr> +<a name="children-prop"></a><span class="qmldefault">[default] </span><span class="name">children</span> : <span class="type">list</span><<span class="type"><a href="qml-qdoc-test-child.html">Child</a></span>></p></td></tr> </table></div></div> <div class="qmldoc"><p>Children of the type.</p> </div></div><!-- @@@children --> @@ -57,7 +57,7 @@ <div class="table"><table class="qmlname"> <tr valign="top" class="odd" id="rear-method"> <td class="tblQmlFuncNode"><p> -<span class="type">void</span> <span class="name">rear</span>(<i>child</i>)</p></td></tr> +<a name="rear-method"></a><span class="type">void</span> <span class="name">rear</span>(<i>child</i>)</p></td></tr> </table></div></div> <div class="qmldoc"><p>Do some abstract parenting on <i>child</i>.</p> </div></div><!-- @@@rear --> diff --git a/tests/auto/qdoc/generatedoutput/expected_output/qml-qdoc-test-doctest.html b/tests/auto/qdoc/generatedoutput/expected_output/qml-qdoc-test-doctest.html index a88d935be..e1475d5fb 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/qml-qdoc-test-doctest.html +++ b/tests/auto/qdoc/generatedoutput/expected_output/qml-qdoc-test-doctest.html @@ -50,7 +50,7 @@ <div class="table"><table class="qmlname"> <tr valign="top" class="odd" id="active-prop"> <td class="tblQmlPropNode"><p> -<span class="name">active</span> : <span class="type">bool</span></p></td></tr> +<a name="active-prop"></a><span class="name">active</span> : <span class="type">bool</span></p></td></tr> </table></div></div> <div class="qmldoc"><p>Whether the test is active.</p> <p><b>See also </b><a href="qml-qdoc-test-doctest.html#name-prop">name</a>.</p> @@ -61,7 +61,7 @@ <div class="table"><table class="qmlname"> <tr valign="top" class="odd" id="name-prop"> <td class="tblQmlPropNode"><p> -<span class="name">name</span> : <span class="type">string</span></p></td></tr> +<a name="name-prop"></a><span class="name">name</span> : <span class="type">string</span></p></td></tr> </table></div></div> <div class="qmldoc"><p>Name of the test.</p> <pre class="qml"><span class="type"><a href="qml-qdoc-test-doctest.html">DocTest</a></span> { @@ -76,7 +76,7 @@ <div class="table"><table class="qmlname"> <tr valign="top" class="odd" id="fail-method"> <td class="tblQmlFuncNode"><p> -<span class="name">fail</span>(<i>message</i> = "oops")</p></td></tr> +<a name="fail-method"></a><span class="name">fail</span>(<i>message</i> = "oops")</p></td></tr> </table></div></div> <div class="qmldoc"><p>Fails the current test case, with the optional <i>message</i>.</p> <p>This method was introduced in QDoc.Test 1.0.</p> 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 363a4bf16..166cbee81 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 @@ -75,10 +75,10 @@ <div class="table"><table class="qmlname"> <tr valign="top" class="odd" id="fifth-prop"> <td class="tblQmlPropNode"><p> -<span class="name">fifth</span> : <span class="type"><a href="qml-int.html">int</a></span></p></td></tr> +<a name="fifth-prop"></a><span class="name">fifth</span> : <span class="type"><a href="qml-int.html">int</a></span></p></td></tr> <tr valign="top" class="odd" id="fourth-prop"> <td class="tblQmlPropNode"><p> -<span class="name">fourth</span> : <span class="type"><a href="qml-int.html">int</a></span></p></td></tr> +<a name="fourth-prop"></a><span class="name">fourth</span> : <span class="type"><a href="qml-int.html">int</a></span></p></td></tr> </table></div></div> </div><div class="qmldoc"><p>A group of properties sharing a documentation comment.</p> </div></div><!-- @@@ --> @@ -86,16 +86,16 @@ <!-- $$$group --> <div class="qmlitem"><div class="qmlproto"> <div class="table"><table class="qmlname"> -<tr valign="top" class="even" id="group-prop"><th class="centerAlign"><p><b>group group</b></p></th></tr> +<tr valign="top" class="even" id="group-prop"><th class="centerAlign"><p><a name="group-prop"></a><b>group group</b></p></th></tr> <tr valign="top" class="odd" id="group.first-prop"> <td class="tblQmlPropNode"><p> -<span class="name">group.first</span> : <span class="type"><a href="qml-int.html">int</a></span></p></td></tr> +<a name="group.first-prop"></a><span class="name">group.first</span> : <span class="type"><a href="qml-int.html">int</a></span></p></td></tr> <tr valign="top" class="odd" id="group.second-prop"> <td class="tblQmlPropNode"><p> -<span class="name">group.second</span> : <span class="type"><a href="qml-int.html">int</a></span></p></td></tr> +<a name="group.second-prop"></a><span class="name">group.second</span> : <span class="type"><a href="qml-int.html">int</a></span></p></td></tr> <tr valign="top" class="odd" id="group.third-prop"> <td class="tblQmlPropNode"><p> -<span class="name">group.third</span> : <span class="type"><a href="qml-int.html">int</a></span></p></td></tr> +<a name="group.third-prop"></a><span class="name">group.third</span> : <span class="type"><a href="qml-int.html">int</a></span></p></td></tr> </table></div></div> <div class="qmldoc"><p>A property group.</p> </div></div><!-- @@@group --> @@ -105,7 +105,7 @@ <div class="table"><table class="qmlname"> <tr valign="top" class="odd" id="id-prop"> <td class="tblQmlPropNode"><p> -<span class="qmlreadonly">[read-only] </span><span class="name">id</span> : <span class="type"><a href="qml-int.html">int</a></span></p></td></tr> +<a name="id-prop"></a><span class="qmlreadonly">[read-only] </span><span class="name">id</span> : <span class="type"><a href="qml-int.html">int</a></span></p></td></tr> </table></div></div> <div class="qmldoc"><p>A read-only property.</p> </div></div><!-- @@@id --> @@ -115,7 +115,7 @@ <div class="table"><table class="qmlname"> <tr valign="top" class="odd" id="name-prop"> <td class="tblQmlPropNode"><p> -<span class="name">name</span> : <span class="type">string</span></p></td></tr> +<a name="name-prop"></a><span class="name">name</span> : <span class="type">string</span></p></td></tr> </table></div></div> <div class="qmldoc"><p>Name of the Test.</p> </div></div><!-- @@@name --> @@ -126,7 +126,7 @@ <div class="table"><table class="qmlname"> <tr valign="top" class="odd" id="type-attached-prop"> <td class="tblQmlPropNode"><p> -<span class="name">Type.type</span> : <span class="type">enumeration</span></p></td></tr> +<a name="type-attached-prop"></a><span class="name">Type.type</span> : <span class="type">enumeration</span></p></td></tr> </table></div></div> <div class="qmldoc"><div class="table"><table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tbldscr">Description</th></tr> <tr><td class="topAlign"><code>Type.NoType</code></td><td class="topAlign">Nothing</td></tr> @@ -140,7 +140,7 @@ <div class="table"><table class="qmlname"> <tr valign="top" class="odd" id="completed-signal"> <td class="tblQmlFuncNode"><p> -<span class="name">completed</span>(<i>status</i>)</p></td></tr> +<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> </div></div><!-- @@@completed --> @@ -151,7 +151,7 @@ <div class="table"><table class="qmlname"> <tr valign="top" class="odd" id="configured-signal"> <td class="tblQmlFuncNode"><p> -<span class="name">configured</span>()</p></td></tr> +<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> </div></div><!-- @@@configured --> @@ -163,10 +163,10 @@ <div class="table"><table class="qmlname"> <tr valign="top" class="odd" id="disable-method"> <td class="tblQmlFuncNode"><p> -<span class="name">disable</span>()</p></td></tr> +<a name="disable-method"></a><span class="name">disable</span>()</p></td></tr> <tr valign="top" class="odd" id="enable-method"> <td class="tblQmlFuncNode"><p> -<span class="name">enable</span>()</p></td></tr> +<a name="enable-method"></a><span class="name">enable</span>()</p></td></tr> </table></div></div> </div><div class="qmldoc"><p>Enables or disables this type.</p> </div></div><!-- @@@ --> @@ -176,7 +176,7 @@ <div class="table"><table class="qmlname"> <tr valign="top" class="odd" id="copy-method"> <td class="tblQmlFuncNode"><p> -<span class="type"><a href="qml-qdoc-test-type.html">Type</a></span> <span class="name">copy</span>(<i>a</i>)</p></td></tr> +<a name="copy-method"></a><span class="type"><a href="qml-qdoc-test-type.html">Type</a></span> <span class="name">copy</span>(<i>a</i>)</p></td></tr> </table></div></div> <div class="qmldoc"><p>Returns another Type based on <i>a</i>.</p> </div></div><!-- @@@copy --> diff --git a/tests/auto/qdoc/generatedoutput/expected_output/qml-uicomponents-progressbar.html b/tests/auto/qdoc/generatedoutput/expected_output/qml-uicomponents-progressbar.html index 6cfe36a83..a1b43ea9d 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/qml-uicomponents-progressbar.html +++ b/tests/auto/qdoc/generatedoutput/expected_output/qml-uicomponents-progressbar.html @@ -46,7 +46,7 @@ <div class="table"><table class="qmlname"> <tr valign="top" class="odd" id="color-prop"> <td class="tblQmlPropNode"><p> -<span class="name">color</span> : <span class="type">color</span></p></td></tr> +<a name="color-prop"></a><span class="name">color</span> : <span class="type">color</span></p></td></tr> </table></div></div> <div class="qmldoc"><p>The color of the <a href="qml-uicomponents-progressbar.html">ProgressBar</a>'s gradient. Must bind to a color type.</p> <p><b>See also </b><a href="qml-uicomponents-progressbar.html#secondColor-prop">secondColor</a>.</p> @@ -57,7 +57,7 @@ <div class="table"><table class="qmlname"> <tr valign="top" class="odd" id="maximum-prop"> <td class="tblQmlPropNode"><p> -<span class="name">maximum</span> : <span class="type"><a href="qml-int.html">int</a></span></p></td></tr> +<a name="maximum-prop"></a><span class="name">maximum</span> : <span class="type"><a href="qml-int.html">int</a></span></p></td></tr> </table></div></div> <div class="qmldoc"><p>The maximum value of the <a href="qml-uicomponents-progressbar.html">ProgressBar</a> range. The <a href="qml-uicomponents-progressbar.html#value-prop">value</a> must not be more than this value.</p> </div></div><!-- @@@maximum --> @@ -67,7 +67,7 @@ <div class="table"><table class="qmlname"> <tr valign="top" class="odd" id="minimum-prop"> <td class="tblQmlPropNode"><p> -<span class="name">minimum</span> : <span class="type"><a href="qml-int.html">int</a></span></p></td></tr> +<a name="minimum-prop"></a><span class="name">minimum</span> : <span class="type"><a href="qml-int.html">int</a></span></p></td></tr> </table></div></div> <div class="qmldoc"><p>The minimum value of the <a href="qml-uicomponents-progressbar.html">ProgressBar</a> range. The <a href="qml-uicomponents-progressbar.html#value-prop">value</a> must not be less than this value.</p> </div></div><!-- @@@minimum --> @@ -77,7 +77,7 @@ <div class="table"><table class="qmlname"> <tr valign="top" class="odd" id="secondColor-prop"> <td class="tblQmlPropNode"><p> -<span class="name">secondColor</span> : <span class="type">color</span></p></td></tr> +<a name="secondColor-prop"></a><span class="name">secondColor</span> : <span class="type">color</span></p></td></tr> </table></div></div> <div class="qmldoc"><p>The second color of the <a href="qml-uicomponents-progressbar.html">ProgressBar</a>'s gradient. Must bind to a color type.</p> <p><b>See also </b><a href="qml-uicomponents-progressbar.html#color-prop">color</a>.</p> @@ -88,7 +88,7 @@ <div class="table"><table class="qmlname"> <tr valign="top" class="odd" id="value-prop"> <td class="tblQmlPropNode"><p> -<span class="name">value</span> : <span class="type"><a href="qml-int.html">int</a></span></p></td></tr> +<a name="value-prop"></a><span class="name">value</span> : <span class="type"><a href="qml-int.html">int</a></span></p></td></tr> </table></div></div> <div class="qmldoc"><p>The value of the progress.</p> </div></div><!-- @@@value --> diff --git a/tests/auto/qdoc/generatedoutput/expected_output/qml-uicomponents-switch.html b/tests/auto/qdoc/generatedoutput/expected_output/qml-uicomponents-switch.html index 5ebae4905..fadb1a531 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/qml-uicomponents-switch.html +++ b/tests/auto/qdoc/generatedoutput/expected_output/qml-uicomponents-switch.html @@ -48,7 +48,7 @@ <div class="table"><table class="qmlname"> <tr valign="top" class="odd" id="on-prop"> <td class="tblQmlPropNode"><p> -<span class="name">on</span> : <span class="type">bool</span></p></td></tr> +<a name="on-prop"></a><span class="name">on</span> : <span class="type">bool</span></p></td></tr> </table></div></div> <div class="qmldoc"><p>Indicates the state of the switch. If <code>false</code>, then the switch is in the <code>off</code> state.</p> </div></div><!-- @@@on --> @@ -59,7 +59,7 @@ <div class="table"><table class="qmlname"> <tr valign="top" class="odd" id="toggle-method"> <td class="tblQmlFuncNode"><p> -<span class="name">toggle</span>()</p></td></tr> +<a name="toggle-method"></a><span class="name">toggle</span>()</p></td></tr> </table></div></div> <div class="qmldoc"><p>A method to toggle the switch. If the switch is <code>on</code>, the toggling it will turn it <code>off</code>. Toggling a switch in the <code>off</code> position will turn it <code>on</code>.</p> </div></div><!-- @@@toggle --> diff --git a/tests/auto/qdoc/generatedoutput/expected_output/qml-uicomponents-tabwidget.html b/tests/auto/qdoc/generatedoutput/expected_output/qml-uicomponents-tabwidget.html index 2c48e1ddd..1b2421722 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/qml-uicomponents-tabwidget.html +++ b/tests/auto/qdoc/generatedoutput/expected_output/qml-uicomponents-tabwidget.html @@ -62,7 +62,7 @@ <div class="table"><table class="qmlname"> <tr valign="top" class="odd" id="current-prop"> <td class="tblQmlPropNode"><p> -<span class="name">current</span> : <span class="type"><a href="qml-int.html">int</a></span></p></td></tr> +<a name="current-prop"></a><span class="name">current</span> : <span class="type"><a href="qml-int.html">int</a></span></p></td></tr> </table></div></div> <div class="qmldoc"><p>The currently active tab in the <a href="qml-uicomponents-tabwidget.html">TabWidget</a>.</p> </div></div><!-- @@@current --> @@ -72,7 +72,7 @@ <div class="table"><table class="qmlname"> <tr valign="top" class="odd" id="sampleReadOnlyProperty-prop"> <td class="tblQmlPropNode"><p> -<span class="qmlreadonly">[read-only] </span><span class="name">sampleReadOnlyProperty</span> : <span class="type"><a href="qml-int.html">int</a></span></p></td></tr> +<a name="sampleReadOnlyProperty-prop"></a><span class="qmlreadonly">[read-only] </span><span class="name">sampleReadOnlyProperty</span> : <span class="type"><a href="qml-int.html">int</a></span></p></td></tr> </table></div></div> <div class="qmldoc"><p>A sample <code>read-only</code> property. A contrived property to demonstrate QDoc's ability to detect read-only properties.</p> <p>The signature is:</p> |