summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Boddie <david.boddie@qt.io>2025-02-07 18:50:49 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2025-12-12 22:50:15 +0000
commitbbd2b130de94f0c29d93a6b624a767af3d1cd93c (patch)
tree40155c3ee694c8c2a385ceca0a1d7124a01c1a04
parent723ea03a6f051a68492af869633a3ec9c7a4d686 (diff)
qdoc: Resolve scoped enum values, not just class enum values6.10
The check for scoped enums only worked for class enums. By removing the check, we can search inside named enums for values. Pick-to: 6.8 Change-Id: If1a9213dee7a57957a8be70f95cdf4f82f6bef52 Reviewed-by: Topi Reinio <topi.reinio@qt.io> (cherry picked from commit f413444989feb28aa831d3f7305b230c946f151b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit ddc5aa52497fb933086d99234abe81ebf90217c4)
-rw-r--r--src/qdoc/qdoc/src/qdoc/tree.cpp2
-rw-r--r--src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/scopedenum/expected/docbook/scoped-enum-linking.xml2
-rw-r--r--src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/scopedenum/expected/html/scoped-enum-linking.html2
-rw-r--r--src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/scopedenum/expected/webxml/scoped-enum-linking.webxml3
-rw-r--r--src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/scopedenum/src/scopedenum.qdoc4
5 files changed, 7 insertions, 6 deletions
diff --git a/src/qdoc/qdoc/src/qdoc/tree.cpp b/src/qdoc/qdoc/src/qdoc/tree.cpp
index bff91a732..4b558be4e 100644
--- a/src/qdoc/qdoc/src/qdoc/tree.cpp
+++ b/src/qdoc/qdoc/src/qdoc/tree.cpp
@@ -716,7 +716,7 @@ const Node *Tree::findEnumNode(const Node *node, const Node *aggregate, const QS
// Scoped enum (path ends in enum_name :: enum_value)
if (node && node->isEnumType() && offset == path.size() - 1) {
const auto *en = static_cast<const EnumNode*>(node);
- if (en->isScoped() && en->hasItem(path.last()))
+ if (en->hasItem(path.last()))
return en;
}
diff --git a/src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/scopedenum/expected/docbook/scoped-enum-linking.xml b/src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/scopedenum/expected/docbook/scoped-enum-linking.xml
index 51f0326df..9c3b32ccd 100644
--- a/src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/scopedenum/expected/docbook/scoped-enum-linking.xml
+++ b/src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/scopedenum/expected/docbook/scoped-enum-linking.xml
@@ -8,5 +8,5 @@
<db:para>TestCPP Reference Documentation.</db:para></db:abstract>
</db:info>
<db:para>Linking to <db:link xlink:href="testqdoc-test.xml#ScopedEnum-enum">All</db:link>.</db:para>
-<db:para>TestQDoc::Test::ClassicEnum::Howdy does not link, but <db:link xlink:href="testqdoc-test.xml#ClassicEnum-enum">TestQDoc::Test::Howdy</db:link> might.</db:para>
+<db:para><db:link xlink:href="testqdoc-test.xml#ClassicEnum-enum">TestQDoc::Test::ClassicEnum::Howdy</db:link> links, and <db:link xlink:href="testqdoc-test.xml#ClassicEnum-enum">TestQDoc::Test::Howdy</db:link> might also link.</db:para>
</db:article>
diff --git a/src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/scopedenum/expected/html/scoped-enum-linking.html b/src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/scopedenum/expected/html/scoped-enum-linking.html
index 5f40bbab7..246bed76b 100644
--- a/src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/scopedenum/expected/html/scoped-enum-linking.html
+++ b/src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/scopedenum/expected/html/scoped-enum-linking.html
@@ -11,7 +11,7 @@
<!-- $$$scoped-enum-linking.html-description -->
<div class="descr" id="details">
<p>Linking to <a href="testqdoc-test.html#ScopedEnum-enum" translate="no">All</a>.</p>
-<p>TestQDoc::Test::ClassicEnum::Howdy does not link, but <a href="testqdoc-test.html#ClassicEnum-enum" translate="no">TestQDoc::Test::Howdy</a> might.</p>
+<p><a href="testqdoc-test.html#ClassicEnum-enum" translate="no">TestQDoc::Test::ClassicEnum::Howdy</a> links, and <a href="testqdoc-test.html#ClassicEnum-enum" translate="no">TestQDoc::Test::Howdy</a> might also link.</p>
</div>
<!-- @@@scoped-enum-linking.html -->
</body>
diff --git a/src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/scopedenum/expected/webxml/scoped-enum-linking.webxml b/src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/scopedenum/expected/webxml/scoped-enum-linking.webxml
index 62091e656..8988a0abe 100644
--- a/src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/scopedenum/expected/webxml/scoped-enum-linking.webxml
+++ b/src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/scopedenum/expected/webxml/scoped-enum-linking.webxml
@@ -4,7 +4,8 @@
<page name="scoped-enum-linking.html" href="scoped-enum-linking.html" status="active" location="scopedenum.qdoc" documented="true" subtype="page" title="Enum Linking" fulltitle="Enum Linking" subtitle="">
<description>
<para>Linking to <link raw="TestQDoc::Test::ScopedEnum::All" href="testqdoc-test.html#ScopedEnum-enum" type="enum" enum="TestQDoc::Test::ScopedEnum">All</link>.</para>
- <para>TestQDoc::Test::ClassicEnum::Howdy does not link, but <link raw="TestQDoc::Test::Howdy" href="testqdoc-test.html#ClassicEnum-enum" type="enum" enum="TestQDoc::Test::ClassicEnum">TestQDoc::Test::Howdy</link> might.</para>
+ <para>
+ <link raw="TestQDoc::Test::ClassicEnum::Howdy" href="testqdoc-test.html#ClassicEnum-enum" type="enum" enum="TestQDoc::Test::ClassicEnum">TestQDoc::Test::ClassicEnum::Howdy</link> links, and <link raw="TestQDoc::Test::Howdy" href="testqdoc-test.html#ClassicEnum-enum" type="enum" enum="TestQDoc::Test::ClassicEnum">TestQDoc::Test::Howdy</link> might also link.</para>
</description>
</page>
</document>
diff --git a/src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/scopedenum/src/scopedenum.qdoc b/src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/scopedenum/src/scopedenum.qdoc
index 22ef9e3f3..b8af02b6a 100644
--- a/src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/scopedenum/src/scopedenum.qdoc
+++ b/src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/scopedenum/src/scopedenum.qdoc
@@ -31,8 +31,8 @@
Linking to \l {TestQDoc::Test::ScopedEnum::}{All}.
- TestQDoc::Test::ClassicEnum::Howdy does not link,
- but TestQDoc::Test::Howdy might.
+ TestQDoc::Test::ClassicEnum::Howdy links,
+ and TestQDoc::Test::Howdy might also link.
*/
/*!