QDoc: Hide undocumented base classes in inheritance lists
A class with no documentation comment is only marked internal when
QDoc marks undocumented children internal, which happens after the
inheritance lists are pruned of private and internal classes. The
class therefore survives in the Inherits and Inherited By lists, and
in the bases attribute of the index file, of its documented
relatives. Because the class is not part of the documented API, the
reference renders as plain, unlinked text. Base classes documented
with \internal are pruned correctly, so only undocumented ones leak.
Move the removal of private and internal base classes to run after
the undocumented-children marking, so auto-internal classes are
pruned like explicit ones, and their nearest public ancestors are
promoted instead. QSharedDataPointer and QExplicitlySharedDataPointer
lose their Inherits row, and documented classes derived through an
undocumented base inherit the promoted public base, in both HTML and
template output.
Add regression fixtures covering an explicitly internal base, an
undocumented base, and an undocumented root, for HTML output and the
template generator.
Fixes: QTBUG-151134
Pick-to: 6.12
Change-Id: I25c1c226088d0ada017c788027f29b0e0dafc32e
Reviewed-by: Topi Reinio <topi.reinio@qt.io>
Reviewed-by: David Boddie <david.boddie@qt.io>
| commit | e075a950eae003de9950bd81413ddc44ad0f1084 |
| parent | 5a4056af7b59660566235cb537146fea34048929 |
| author | Paul Wicking <paul.wicking@qt.io> |
| committer | Paul Wicking <paul.wicking@qt.io> |
| commit time | Tue, 6 Oct 2026 10:44:46 +0000 |
- M src/qdoc/qdoc/src/qdoc/qdocdatabase.cpp
- A src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/undocumented_base_classes/expected/html/onlyundocumentedroot.html
- A src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/undocumented_base_classes/expected/html/publicbase.html
- A src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/undocumented_base_classes/expected/html/undocumentedbaseclasses-module.html
- A src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/undocumented_base_classes/expected/html/undocumentedbaseclasses.index
- A src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/undocumented_base_classes/expected/html/viaexplicit.html
- A src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/undocumented_base_classes/expected/html/viaundocumented.html
- A src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/undocumented_base_classes/src/bases.h
- A src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/undocumented_base_classes/undocumented_base_classes.qdocconf
- A src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/undocumented_base_classes/expected/template/onlyundocumentedroot.md
- A src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/undocumented_base_classes/expected/template/publicbase.md
- A src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/undocumented_base_classes/expected/template/undocumentedbaseclasses-module.md
- A src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/undocumented_base_classes/expected/template/viaexplicit.md
- A src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/undocumented_base_classes/expected/template/viaundocumented.md
- A src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/undocumented_base_classes/expected/undocumentedbaseclasses.index
- A src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/undocumented_base_classes/src/bases.h
- A src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/undocumented_base_classes/undocumented_base_classes.qdocconf