summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/index-linking.html10
-rw-r--r--tests/auto/qdoc/generatedoutput/expected_output/properties/testcpp.index4
-rw-r--r--tests/auto/qdoc/generatedoutput/testdata/indexlinking/linking.qdoc16
3 files changed, 28 insertions, 2 deletions
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/index-linking.html b/tests/auto/qdoc/generatedoutput/expected_output/index-linking.html
index 09d3ef0fd..694a3f061 100644
--- a/tests/auto/qdoc/generatedoutput/expected_output/index-linking.html
+++ b/tests/auto/qdoc/generatedoutput/expected_output/index-linking.html
@@ -11,6 +11,7 @@
<h3 id="toc">Contents</h3>
<ul>
<li class="level1"><a href="#qml-properties">QML properties</a></li>
+<li class="level1"><a href="#auto-linking-to-types-in-code-snippets">Auto-linking to types in code snippets</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
@@ -21,6 +22,15 @@
<ol class="A" type="A"><li>Property group: <a href="https://doc.qt.io/QmlPropertyGroups/qml-qdoc-test-parent.html#group-prop" translate="no">Parent::group</a>.</li>
<li>Property in a group: <a href="https://doc.qt.io/QmlPropertyGroups/qml-qdoc-test-parent.html#group.c-prop" translate="no">QDoc.Test::Parent::group.c</a>.</li>
</ol>
+<h2 id="auto-linking-to-types-in-code-snippets">Auto-linking to types in code snippets</h2>
+<pre class="qml" translate="no">import QtQuick
+
+<span class="type"><a href="https://doc.qt.io/QmlPropertyGroups/qml-uicomponents-progressbar.html" translate="no">ProgressBar</a></span> {
+ <span class="comment">// Linking to int value type</span>
+ property <span class="type"><a href="https://doc.qt.io/QmlPropertyGroups/qml-int.html" translate="no">int</a></span> <span class="name">progress</span>: <span class="number">0</span>
+}</pre>
+<pre class="cpp" translate="no"><span class="comment">// 'int' should not link anywhere in C++ code</span>
+<span class="type">int</span> main() { <span class="type">int</span> x{<span class="number">0</span>}; <span class="keyword">return</span> x; }</pre>
</div>
<!-- @@@index-linking.html -->
</body>
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/properties/testcpp.index b/tests/auto/qdoc/generatedoutput/expected_output/properties/testcpp.index
index 8a9d8c067..3a7ea6d8b 100644
--- a/tests/auto/qdoc/generatedoutput/expected_output/properties/testcpp.index
+++ b/tests/auto/qdoc/generatedoutput/expected_output/properties/testcpp.index
@@ -105,7 +105,7 @@
</property>
</class>
</namespace>
- <qmlclass name="TheType" qml-module-name="TheType" href="qml-thetype.html" status="active" access="public" location="properties.qdoc" documented="true" title="TheType" fulltitle="TheType" subtitle="">
+ <qmlclass name="TheType" href="qml-thetype.html" status="active" access="public" location="properties.qdoc" documented="true" title="TheType" fulltitle="TheType" subtitle="">
<qmlproperty name="name" fullname="TheType::name" href="qml-thetype.html#name-prop" status="active" access="public" location="properties.qdoc" documented="true" type="string" attached="false" writable="false" brief="Read-only status of this property is resolved from Q_PROPERTY"/>
</qmlclass>
<group name="cpptypes" href="cpptypes.html" status="active" location="classlists.qdoc" documented="true" seen="true" title="Test C++ Types"/>
@@ -114,6 +114,6 @@
<contents name="linking-to-function-like-things" title="Linking to function-like things" level="1"/>
<contents name="section" title="section()" level="2"/>
</module>
- <qmlmodule name="TheModule" qml-module-name="TheModule" href="themodule-qmlmodule.html" status="internal" seen="false" title=""/>
+ <qmlmodule name="TheModule" href="themodule-qmlmodule.html" status="internal" seen="false" title=""/>
</namespace>
</INDEX>
diff --git a/tests/auto/qdoc/generatedoutput/testdata/indexlinking/linking.qdoc b/tests/auto/qdoc/generatedoutput/testdata/indexlinking/linking.qdoc
index d65f2ef68..fe60bc7a6 100644
--- a/tests/auto/qdoc/generatedoutput/testdata/indexlinking/linking.qdoc
+++ b/tests/auto/qdoc/generatedoutput/testdata/indexlinking/linking.qdoc
@@ -11,6 +11,22 @@
\li Property in a group: \l [QmlPropertyGroups]
QDoc.Test::Parent::group.c.
\endlist
+
+ \section1 Auto-linking to types in code snippets
+
+ \qml
+ import QtQuick
+
+ ProgressBar {
+ // Linking to int value type
+ property int progress: 0
+ }
+ \endqml
+
+ \code
+ // 'int' should not link anywhere in C++ code
+ int main() { int x{0}; return x; }
+ \endcode
*/
/*!