QDoc: Add a Qt-branded template scenario
The template generator already supports external template directories
via per-format config, with embedded QRC defaults as a fallback, but
nothing in the tree demonstrated the feature end-to-end or proved
the fallback still resolves inherited partials correctly when a
theme overrides only some files.
A new end-to-end test scenario ships a minimal Qt-branded template
set — dark header chrome with the Qt documentation logo over CDN, an
interactive toolbar, Qt-green accents and typography, and the Qt
copyright footer. All other partials inherit from the embedded
defaults, so the scenario also exercises the two-tier fallback path.
It doubles as the regression guard for the Qt brand surface: any
change to the resolution order, the asset-copy strategy, or the
inherited-partial contract breaks the scenario immediately on ctest.
Exercising the feature in a realistic include chain surfaced a latent
bug in relative templatedir resolution. QDoc tracked one process-wide
"current directory" pinned to the outermost .qdocconf, so a template
directory declared in a globally included config resolved against
whichever module's doc tree the build started from, never the shared
location the include author intended. The template generator now
resolves relative paths against the directory of the config file
that declared the setting. Absolute paths and the process-wide
fallback for programmatic insertion keep working.
Task-number: QTBUG-145963
Change-Id: I27f419bce7b92ad1f56371943b91dc77b3e759f6
Reviewed-by: Topi Reinio <topi.reinio@qt.io>
| commit | f0305e70ddd2ac7e51aded884672c58f379b83d0 |
| parent | 2f47db763fb0622b4b98cc7c2c6ba6d270442567 |
| author | Paul Wicking <paul.wicking@qt.io> |
| committer | Paul Wicking <paul.wicking@qt.io> |
| commit time | Thu, 23 Apr 2026 20:45:20 +0000 |
- M REUSE.toml
- M licenseRule.json
- M src/qdoc/qdoc/src/qdoc/config.h
- M src/qdoc/qdoc/src/qdoc/templategenerator.cpp
- A src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/qt_branded_template/expected/html/index.html
- A src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/qt_branded_template/expected/html/qdoc-default.css
- A src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/qt_branded_template/expected/md/index.md
- A src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/qt_branded_template/expected/qt-branded-template-test.index
- A src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/qt_branded_template/qt_branded_template.qdocconf
- A src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/qt_branded_template/src/index.qdoc
- A src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/qt_branded_template/template/assets/qdoc-default.css
- A src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/qt_branded_template/template/collection.html
- A src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/qt_branded_template/template/cppref.html
- A src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/qt_branded_template/template/members.html
- A src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/qt_branded_template/template/obsolete.html
- A src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/qt_branded_template/template/page.html
- A src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/qt_branded_template/template/partials/qt-branded/footer.html
- A src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/qt_branded_template/template/partials/qt-branded/header-bar.html
- A src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/qt_branded_template/template/partials/qt-branded/toolbar.html
- A src/qdoc/qdoc/tests/validatetemplategeneratoroutput/testdata/qt_branded_template/template/qmltype.html