QDoc: Detect module namespaces correctly
When QDoc decides whether a module has namespaces, it checks the
module's members for classes instead. A module with classes but no
namespaces therefore appears to have namespaces, and a module with
only namespaces appears to have none.
This shows up on the generated module pages. In HTML, the table of
contents lists a `Namespaces` entry that leads nowhere for modules
without namespaces, and leaves the entry out for modules whose page
does render a `Namespaces` section. In WebXML, modules without
namespaces get an empty `Namespaces` section, and modules with only
namespaces get no section at all.
QDoc now checks for namespaces, so the table of contents and the
WebXML output match the namespaces the module actually has. The
expected output for the affected test modules changes to match.
Fixes: QTBUG-151295
Pick-to: 6.12
Change-Id: Id0b51de7e27add7649a7573138761627102673f4
Reviewed-by: David Boddie <david.boddie@qt.io>
| commit | caf225a90f08d9624d0a086d28e0b95fb4ae6af2 |
| parent | b27399be04135784d8343a9e6761e1fdfa743316 |
| author | Paul Wicking <paul.wicking@qt.io> |
| committer | Paul Wicking <paul.wicking@qt.io> |
| commit time | Thu, 8 Oct 2026 11:01:45 +0000 |
- M src/qdoc/qdoc/src/qdoc/collectionnode.cpp
- M src/qdoc/qdoc/tests/multimoduleconfigurations/testdata/cross_module_links/expected/crossmodulelinks/html/consumermodule-module.html
- M src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/case_distinct_anchors/expected/html/casedistinctanchors-module.html
- M src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/cmakedocumentation/expected/html/testcar-module.html
- M src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/cmakedocumentation/expected/html/testcarprivate-module.html
- M src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/cmakedocumentation/expected/webxml/testcar-module.webxml
- M src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/cmakedocumentation/expected/webxml/testcarprivate-module.webxml
- M src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/cpp20_concepts/expected/html/cpp20concepts-module.html
- M src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/cpp20_concepts/expected/webxml/cpp20concepts-module.webxml
- M src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/frienddeclarations/expected/html/friendmodule-module.html
- M src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/frienddeclarations/expected/webxml/friendmodule-module.webxml
- M src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/globalfunc/expected/html/testglobals-module.html
- M src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/hiddenfriends/expected/html/completelyhidden-module.html
- M src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/hiddenfriends/expected/webxml/completelyhidden-module.webxml
- M src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/hiddenfriends_fn/expected/html/hiddenfriendmodule-module.html
- M src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/hiddenfriends_fn/expected/webxml/hiddenfriendmodule-module.webxml
- M src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/includeheader_resolution/expected/html/includeheadermodule-module.html
- M src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/inherited_property_link/expected/html/testmodule-module.html
- M src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/inherited_property_link/expected/webxml/testmodule-module.webxml
- M src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/internal_parameter_warnings/expected/html/internalparametermodule-module.html
- M src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/member_link_hierarchy/expected/html/memberlinks-module.html
- M src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/modulestate/expected/html/moduleinstate-module.html
- M src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/modulestate/expected/webxml/moduleinstate-module.webxml
- M src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/multiline_templates/expected/html/multilinetemplates-module.html
- M src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/multiple_overloads_test/expected/html/testqdocoverloadcommand-module.html
- M src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/multiple_overloads_test/expected/webxml/testqdocoverloadcommand-module.webxml
- M src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/multisignal/expected/html/testmodule-module.html
- M src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/multisignal/expected/webxml/testmodule-module.webxml
- M src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/overloaded_empty_targets/expected/html/overloadedemptytargets-module.html
- M src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/overloaded_empty_targets/expected/overloadedemptytargets-module.webxml
- M src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/overloaded_signals_slots/expected/html/overloadedsignalsslots-module.html
- M src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/overloaded_signals_slots/expected/webxml/overloadedsignalsslots-module.webxml
- M src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/privateheaders/expected/html/privateheadersmodule-module.html
- M src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/privateheaders/expected/webxml/privateheadersmodule-module.webxml
- M src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/privatemembers/expected/html/testmodule-module.html
- M src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/privatemembers/expected/webxml/testmodule-module.webxml
- M src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/privatevirtuals/expected/html/wassilykandinsky-module.html
- M src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/privatevirtuals/expected/webxml/wassilykandinsky-module.webxml
- M src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/qmlenumvaluesfromcpp/expected/html/module-module.html
- M src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/qmlenumvaluesfromcpp/expected/webxml/module-module.webxml
- M src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/reimplemented_test/expected/html/testmodule-module.html
- M src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/reimplemented_test/expected/webxml/testmodule-module.webxml
- M src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/sharedcommentsinnamespace/expected/mod-module.html
- M src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/showinternal/expected/html/showinternalmodule-module.html
- M src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/showinternal/expected/webxml/showinternalmodule-module.webxml
- M src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/template_alias_default_params/expected/html/templatealiasmodule-module.html
- M src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/template_alias_default_params/expected/webxml/templatealiasmodule-module.webxml
- M src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/templateparams/expected/html/testmodule-module.html
- M src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/templateparams/expected/webxml/testmodule-module.webxml
- M src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/undocumented_base_classes/expected/html/undocumentedbaseclasses-module.html
- M src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/unnamedstruct/expected/html/unnamedstructmodule-module.html
- M src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/unnamedstruct/expected/webxml/unnamedstructmodule-module.webxml
- M src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/warninglog/expected/html/relativepathstest-module.html
- M src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/member_link_context/expected/html-legacy/memberlink-module.html