summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVenugopal Shivashankar <Venugopal.Shivashankar@qt.io>2023-05-10 14:00:16 +0200
committerTopi Reiniƶ <topi.reinio@qt.io>2023-05-12 10:05:12 +0000
commit941a9b5e5963f8c0798415e3cb69f031da1f4109 (patch)
tree97a126f32417149bca99bde76af630c80ecfa537
parenteea32dd3313e0370b7a7406f8fe8451865a71007 (diff)
downloadqttools-941a9b5e5963f8c0798415e3cb69f031da1f4109.tar.gz
qdoc: Wrap a <div> around the addendum note
The addendum added to the C++ and QML methods, properties, and signals, lack the necessary styling. They are added as a simple HTML para, without the appropriate admonition CSS class, which is normally used for a \note. Pick-to: 6.5 Change-Id: I10cb9d51c587fb21024168a57e8661f7da0ad323 Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io>
-rw-r--r--src/qdoc/qdoc/generator.cpp5
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/properties/testqdoc-testderived.html16
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/qml-qdoc-test-doctest.html12
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/qml-qdoc-test-type.html12
4 files changed, 24 insertions, 21 deletions
diff --git a/src/qdoc/qdoc/generator.cpp b/src/qdoc/qdoc/generator.cpp
index 0381040d9..ad58b7f44 100644
--- a/src/qdoc/qdoc/generator.cpp
+++ b/src/qdoc/qdoc/generator.cpp
@@ -1226,6 +1226,8 @@ void Generator::generateAddendum(const Node *node, Addendum type, CodeMarker *ma
{
Q_ASSERT(node && !node->name().isEmpty());
Text text;
+ text << Atom(Atom::DivLeft,
+ "class=\"admonition %1\""_L1.arg(generateNote ? u"note"_s : u"auto"_s));
text << Atom::ParaLeft;
if (generateNote) {
@@ -1302,7 +1304,8 @@ void Generator::generateAddendum(const Node *node, Addendum type, CodeMarker *ma
return;
}
- text << Atom::ParaRight;
+ text << Atom::ParaRight
+ << Atom::DivRight;
generateText(text, node, marker);
}
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 5a06f1d41..fd85e3d5c 100644
--- a/tests/auto/qdoc/generatedoutput/expected_output/properties/testqdoc-testderived.html
+++ b/tests/auto/qdoc/generatedoutput/expected_output/properties/testqdoc-testderived.html
@@ -104,8 +104,8 @@ target_link_libraries(mytarget PRIVATE Qt6::QDocTest)</td></tr>
<h2>Property Documentation</h2>
<!-- $$$bindableProp-prop$$$bindableProp$$$setBindablePropconstQString&$$$bindablePropChanged -->
<h3 class="fn" translate="no" id="bindableProp-prop"><code translate="no">[bindable] </code><span class="name">bindableProp</span> : <span class="type">QString</span></h3>
-<p><b>Note: </b>This property supports <a href="https://wiki.qt.io/QProperty" translate="no">QProperty</a> bindings.</p>
-<p>Some property.</p>
+<div class="admonition note"><p><b>Note: </b>This property supports <a href="https://wiki.qt.io/QProperty" translate="no">QProperty</a> bindings.</p>
+</div><p>Some property.</p>
<!-- @@@bindableProp -->
<!-- $$$boolProp-prop$$$boolProp$$$setBoolPropbool$$$resetBoolProp$$$boolPropChanged -->
<h3 class="fn" translate="no" id="boolProp-prop"><span class="name">boolProp</span> : <span class="type">bool</span></h3>
@@ -139,8 +139,8 @@ target_link_libraries(mytarget PRIVATE Qt6::QDocTest)</td></tr>
<!-- @@@name -->
<!-- $$$someProp-prop$$$someProp -->
<h3 class="fn" translate="no" id="someProp-prop"><code translate="no">[bindable read-only] </code><span class="name">someProp</span> : <span class="type">QString</span></h3>
-<p><b>Note: </b>This property supports <a href="https://wiki.qt.io/QProperty" translate="no">QProperty</a> bindings.</p>
-<p>Another property.</p>
+<div class="admonition note"><p><b>Note: </b>This property supports <a href="https://wiki.qt.io/QProperty" translate="no">QProperty</a> bindings.</p>
+</div><p>Another property.</p>
<!-- @@@someProp -->
</div>
<div class="func">
@@ -148,8 +148,8 @@ target_link_libraries(mytarget PRIVATE Qt6::QDocTest)</td></tr>
<!-- $$$emitSomething[overload1]$$$emitSomething -->
<h3 class="fn" translate="no" id="emitSomething"><code translate="no">[private 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 -->
+<div class="admonition note"><p><b>Note: </b>This is a private signal. It can be used in signal connections but cannot be emitted by the user.</p>
+</div><!-- @@@emitSomething -->
<!-- $$$id[overload1]$$$id -->
<h3 class="fn" translate="no" id="id"><code translate="no">[override virtual] </code><span class="type">int</span> TestDerived::<span class="name">id</span>()</h3>
<p>Reimplements an access function for property: <a href="testqdoc-test.html#id-prop" translate="no">Test::id</a>.</p>
@@ -157,8 +157,8 @@ target_link_libraries(mytarget PRIVATE Qt6::QDocTest)</td></tr>
<!-- $$$invokeMe[overload1]$$$invokeMe -->
<h3 class="fn" translate="no" id="invokeMe"><code translate="no">[invokable] </code><span class="type">void</span> TestDerived::<span class="name">invokeMe</span>() const</h3>
<p>Something invokable.</p>
-<p><b>Note: </b>This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.</p>
-<!-- @@@invokeMe -->
+<div class="admonition note"><p><b>Note: </b>This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.</p>
+</div><!-- @@@invokeMe -->
<!-- $$$virtualFun[overload1]$$$virtualFun -->
<h3 class="fn" translate="no" id="virtualFun"><code translate="no">[override virtual] </code><span class="type">void</span> TestDerived::<span class="name">virtualFun</span>()</h3>
<p>Reimplements: <a href="testqdoc-test.html#virtualFun" translate="no">Test::virtualFun</a>().</p>
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 49c8b2730..2608efb1e 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
@@ -84,8 +84,8 @@
<td class="tblQmlFuncNode"><p>
<span class="name">completed</span>()</p></td></tr>
</table></div></div>
-<div class="qmldoc"><p><b>Note: </b>The corresponding handler is <code translate="no">onCompleted</code>.</p>
-</div></div><!-- @@@completed -->
+<div class="qmldoc"><div class="admonition note"><p><b>Note: </b>The corresponding handler is <code translate="no">onCompleted</code>.</p>
+</div></div></div><!-- @@@completed -->
<br/>
<!-- $$$foo[overload1]$$$foovar -->
<div class="qmlitem"><div class="qmlproto" translate="no">
@@ -95,8 +95,8 @@
<span class="name">foo</span>(<span class="type">var</span> <i>bar</i>)</p></td></tr>
</table></div></div>
<div class="qmldoc"><p>Signal with parameter <i translate="no">bar</i>.</p>
-<p><b>Note: </b>The corresponding handler is <code translate="no">onFoo</code>.</p>
-</div></div><!-- @@@foo -->
+<div class="admonition note"><p><b>Note: </b>The corresponding handler is <code translate="no">onFoo</code>.</p>
+</div></div></div><!-- @@@foo -->
<br/>
<!-- $$$itsHappening[overload1]$$$itsHappeningbool -->
<div class="qmlitem"><div class="qmlproto" translate="no">
@@ -106,8 +106,8 @@
<span class="name">itsHappening</span>(<span class="type">bool</span> <i>really</i>)</p></td></tr>
</table></div></div>
<div class="qmldoc"><p>Signals that something is <i translate="no">really</i> happening.</p>
-<p><b>Note: </b>The corresponding handler is <code translate="no">onItsHappening</code>.</p>
-</div></div><!-- @@@itsHappening -->
+<div class="admonition note"><p><b>Note: </b>The corresponding handler is <code translate="no">onItsHappening</code>.</p>
+</div></div></div><!-- @@@itsHappening -->
<br/>
<h2>Method Documentation</h2>
<!-- $$$fail[overload1]$$$fail -->
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 d928fbf18..364d3505d 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
@@ -141,8 +141,8 @@
<span class="name">completed</span>(<span class="type"><a href="qml-int.html" translate="no">int</a></span> <i>status</i>)</p></td></tr>
</table></div></div>
<div class="qmldoc"><p>This signal is emitted when the operation completed with <i translate="no">status</i>.</p>
-<p><b>Note: </b>The corresponding handler is <code translate="no">onCompleted</code>.</p>
-</div></div><!-- @@@completed -->
+<div class="admonition note"><p><b>Note: </b>The corresponding handler is <code translate="no">onCompleted</code>.</p>
+</div></div></div><!-- @@@completed -->
<br/>
<!-- $$$group.created[overload1]$$$group.created -->
<div class="qmlitem"><div class="qmlproto" translate="no">
@@ -152,8 +152,8 @@
<span class="name">group.created</span>()</p></td></tr>
</table></div></div>
<div class="qmldoc"><p>This signal is prefixed with <i>group</i>.</p>
-<p><b>Note: </b>The corresponding handler is <code translate="no">group.onCreated</code>.</p>
-</div></div><!-- @@@group.created -->
+<div class="admonition note"><p><b>Note: </b>The corresponding handler is <code translate="no">group.onCreated</code>.</p>
+</div></div></div><!-- @@@group.created -->
<br/>
<h2>Attached Signal Documentation</h2>
<!-- $$$configured[overload1]$$$configured -->
@@ -164,8 +164,8 @@
<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>
-<p><b>Note: </b>The corresponding handler is <code translate="no">onConfigured</code>.</p>
-</div></div><!-- @@@configured -->
+<div class="admonition note"><p><b>Note: </b>The corresponding handler is <code translate="no">onConfigured</code>.</p>
+</div></div></div><!-- @@@configured -->
<br/>
<h2>Method Documentation</h2>
<!-- $$$ -->