From 559332dc3efa507baaaba4ea8288bdb2318bc73d Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Tue, 11 Feb 2020 11:23:18 +0100 Subject: qdoc: Fix regression in linking to QML properties in offline docs The 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 --- src/qdoc/htmlgenerator.cpp | 6 +++-- .../qml-qdoc-test-abstractparent.html | 4 ++-- .../expected_output/qml-qdoc-test-child.html | 4 ++-- .../expected_output/qml-qdoc-test-doctest.html | 6 ++--- .../expected_output/qml-qdoc-test-type.html | 28 +++++++++++----------- .../qml-uicomponents-progressbar.html | 10 ++++---- .../expected_output/qml-uicomponents-switch.html | 4 ++-- .../qml-uicomponents-tabwidget.html | 4 ++-- 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 "
\n"); QString qmlItemStart("\n" - "\n"); QString qmlItemFooter("

\n"); + "

\n"); QString qmlItemEnd("

\n"); @@ -3656,8 +3656,10 @@ void HtmlGenerator::generateDetailedQmlMember(Node *node, const Aggregate *relat const SharedCommentNode *scn = static_cast(node); out() << qmlItemHeader; if (!scn->name().isEmpty()) { - out() << ""; + const QString nodeRef = refForNode(scn); + out() << ""; out() << "

"; + out() << ""; out() << "" << scn->name() << " group"; out() << "

\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 @@
+[default] children : list<Child>

-[default] children : list<Child>

Children of the type.

@@ -57,7 +57,7 @@
+voidrear(child)

-void rear(child)

Do some abstract parenting on child.

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 @@
+[default] children : list<Child>

-[default] children : list<Child>

Children of the type.

@@ -57,7 +57,7 @@
+voidrear(child)

-void rear(child)

Do some abstract parenting on child.

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 @@
+active : bool

-active : bool

Whether the test is active.

See also name.

@@ -61,7 +61,7 @@
+name : string

-name : string

Name of the test.

DocTest {
@@ -76,7 +76,7 @@
 
+fail(message = "oops")

-fail(message = "oops")

Fails the current test case, with the optional message.

This method was introduced in QDoc.Test 1.0.

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 @@
+fifth : int

+fourth : int

-fifth : int

-fourth : int

A group of properties sharing a documentation comment.

@@ -86,16 +86,16 @@
- + +group.first : int

+group.second : int

+group.third : int

group group

group group

-group.first : int

-group.second : int

-group.third : int

A property group.

@@ -105,7 +105,7 @@
+[read-only] id : int

-[read-only] id : int

A read-only property.

@@ -115,7 +115,7 @@
+name : string

-name : string

Name of the Test.

@@ -126,7 +126,7 @@
+Type.type : enumeration

-Type.type : enumeration

@@ -140,7 +140,7 @@
ConstantDescription
Type.NoTypeNothing
+completed(status)

-completed(status)

This signal is emitted when the operation completed with status.

@@ -151,7 +151,7 @@
+configured()

-configured()

This attached signal is emitted when the type was configured.

@@ -163,10 +163,10 @@
+disable()

+enable()

-disable()

-enable()

Enables or disables this type.

@@ -176,7 +176,7 @@
+Typecopy(a)

-Type copy(a)

Returns another Type based on a.

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 @@
+color : color

-color : color

The color of the ProgressBar's gradient. Must bind to a color type.

See also secondColor.

@@ -57,7 +57,7 @@
+maximum : int

-maximum : int

The maximum value of the ProgressBar range. The value must not be more than this value.

@@ -67,7 +67,7 @@
+minimum : int

-minimum : int

The minimum value of the ProgressBar range. The value must not be less than this value.

@@ -77,7 +77,7 @@
+secondColor : color

-secondColor : color

The second color of the ProgressBar's gradient. Must bind to a color type.

See also color.

@@ -88,7 +88,7 @@
+value : int

-value : int

The value of the progress.

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 @@
+on : bool

-on : bool

Indicates the state of the switch. If false, then the switch is in the off state.

@@ -59,7 +59,7 @@
+toggle()

-toggle()

A method to toggle the switch. If the switch is on, the toggling it will turn it off. Toggling a switch in the off position will turn it on.

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 @@
+current : int

-current : int

The currently active tab in the TabWidget.

@@ -72,7 +72,7 @@
+[read-only] sampleReadOnlyProperty : int

-[read-only] sampleReadOnlyProperty : int

A sample read-only property. A contrived property to demonstrate QDoc's ability to detect read-only properties.

The signature is:

-- cgit v1.2.3