diff options
7 files changed, 41 insertions, 1 deletions
diff --git a/src/qdoc/cppcodemarker.cpp b/src/qdoc/cppcodemarker.cpp index 7d4e8c4ed..32b14d24b 100644 --- a/src/qdoc/cppcodemarker.cpp +++ b/src/qdoc/cppcodemarker.cpp @@ -430,7 +430,7 @@ QString CppCodeMarker::addMarkUp(const QString &in, const Node * /* relative */, do { finish = i; readChar(); - } while (!atEOF && (ch.isLetterOrNumber() || ch == '.')); + } while (!atEOF && (ch.isLetterOrNumber() || ch == '.' || ch == '\'')); tag = QStringLiteral("number"); } else { switch (ch.unicode()) { diff --git a/tests/auto/qdoc/generatedoutput/expected_output/examples-manifest.xml b/tests/auto/qdoc/generatedoutput/expected_output/examples-manifest.xml index 0a32be836..563e3c5a3 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/examples-manifest.xml +++ b/tests/auto/qdoc/generatedoutput/expected_output/examples-manifest.xml @@ -9,6 +9,7 @@ <example docUrl="qthelp://org.qt-project.test.001/test/test-demos-demo-example.html" imageUrl="qthelp://org.qt-project.test.001/test/images/leonardo-da-vinci.png" isTest="true" name="Demo" projectPath="test/demos/demo/demo.pro"> <description><![CDATA[No description available]]></description> <tags>test</tags> + <fileToOpen mainFile="true">test/demos/demo/demo.cpp</fileToOpen> </example> <example docUrl="qthelp://org.qt-project.test.001/test/test-componentset-example.html" isTest="true" name="QML Documentation Example" projectPath="tutorials/componentset/componentset.pro"> <description><![CDATA[Example for documenting QML types.]]></description> diff --git a/tests/auto/qdoc/generatedoutput/expected_output/test-demos-demo-example.html b/tests/auto/qdoc/generatedoutput/expected_output/test-demos-demo-example.html new file mode 100644 index 000000000..c29408d19 --- /dev/null +++ b/tests/auto/qdoc/generatedoutput/expected_output/test-demos-demo-example.html @@ -0,0 +1,23 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="utf-8"> +<!-- demo.qdoc --> + <title>Demo | Test 0.0.1</title> +</head> +<body> +<div class="sidebar"><div class="sidebar-content" id="sidebar-content"></div></div> +<h1 class="title">Demo</h1> +<!-- $$$demos/demo-description --> +<div class="descr" id="details"> +<p class="centerAlign"><img src="images/leonardo-da-vinci.png" alt="" /></p><pre class="cpp" translate="no"> <span class="keyword">if</span> (n <span class="operator">></span> <span class="number">1'000</span>) + <span class="keyword">return</span> <span class="keyword">true</span>;</pre> +<p>Files:</p> +<ul> +<li><a href="test-demos-demo-demo-cpp.html" translate="no">demos/demo/demo.cpp</a></li> +<li><a href="test-demos-demo-demo-pro.html" translate="no">demos/demo/demo.pro</a></li> +</ul> +</div> +<!-- @@@demos/demo --> +</body> +</html> diff --git a/tests/auto/qdoc/generatedoutput/expected_output/test.qhp b/tests/auto/qdoc/generatedoutput/expected_output/test.qhp index 417f5a7fb..7ef863788 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/test.qhp +++ b/tests/auto/qdoc/generatedoutput/expected_output/test.qhp @@ -195,6 +195,8 @@ <file>test-componentset-progressbar-qml.html</file> <file>test-componentset-switch-qml.html</file> <file>test-componentset-tabwidget-qml.html</file> + <file>test-demos-demo-demo-cpp.html</file> + <file>test-demos-demo-demo-pro.html</file> <file>test-demos-demo-example.html</file> <file>test-demos-hidden-example.html</file> <file>test-empty-qmlmodule.html</file> diff --git a/tests/auto/qdoc/generatedoutput/testdata/examples/demos/demo/demo.cpp b/tests/auto/qdoc/generatedoutput/testdata/examples/demos/demo/demo.cpp new file mode 100644 index 000000000..906c6292f --- /dev/null +++ b/tests/auto/qdoc/generatedoutput/testdata/examples/demos/demo/demo.cpp @@ -0,0 +1,11 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +bool isOverThousand(int n) +{ +//! [integer literal with separator] + if (n > 1'000) + return true; +//! [integer literal with separator] + return false; +} diff --git a/tests/auto/qdoc/generatedoutput/testdata/examples/demos/demo/doc/src/demo.qdoc b/tests/auto/qdoc/generatedoutput/testdata/examples/demos/demo/doc/src/demo.qdoc index 82f3352c2..21ebc5588 100644 --- a/tests/auto/qdoc/generatedoutput/testdata/examples/demos/demo/doc/src/demo.qdoc +++ b/tests/auto/qdoc/generatedoutput/testdata/examples/demos/demo/doc/src/demo.qdoc @@ -6,4 +6,6 @@ \title Demo \image leonardo-da-vinci.png //! Icon made by Smashicons from www.flaticon.com + + \snippet demos/demo/demo.cpp integer literal with separator */ diff --git a/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp b/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp index 5c013639a..e8aadeffd 100644 --- a/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp +++ b/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp @@ -352,6 +352,7 @@ void tst_generatedOutput::examplesManifestXmlAndQhp() { testAndCompare("testdata/configs/examples-qhp.qdocconf", "examples-manifest.xml " + "test-demos-demo-example.html " "test.qhp"); } |