QDoc: Introduce 'parsecppcomments' configuration variable
Add an explicit boolean variable to control whether QDoc uses the
Clang-based C++ parser for source files. Setting it to 'false' skips
PCH generation and processes .cpp files via PureDocParser instead, which
is the intended mode for projects that document only QML APIs.
The existing behavior of setting an empty 'moduleheader' to achieve
the same effect is preserved for backwards compatibility; the new
variable takes precedence when both are set.
Add tests covering all moduleheader/parsecppcomments combinations, and
document the variable in the QDoc manual with cross-links to moduleheader.
[ChangeLog][QDoc] Setting 'parsecppcomments' configuration variable to
'no' turns off C++ documentation parsing and speeds up generation of QML-only documentation sets.
Pick-to: 6.12
Task-number: QTBUG-147135
Change-Id: I18d3f5d759b072874e055d3e8f0a8314227656a7
Reviewed-by: David Boddie <david.boddie@qt.io>
| commit | 37b75f575e8b7bf145cd3e00a4b08be436e2dc75 |
| parent | 3c0d81ba830c8e53e3e0e23c9d9dc18a89efcb7e |
| author | Topi Reinio <topi.reinio@qt.io> |
| committer | Topi Reinio <topi.reinio@qt.io> |
| commit time | Thu, 9 Jul 2026 13:10:57 +0000 |
- M src/qdoc/qdoc/doc/qdoc-manual-qdocconf.qdoc
- M src/qdoc/qdoc/src/qdoc/config.cpp
- M src/qdoc/qdoc/src/qdoc/config.h
- M src/qdoc/qdoc/src/qdoc/main.cpp
- A src/qdoc/qdoc/tests/config/testdata/configs/parsecppcomments_default.qdocconf
- A src/qdoc/qdoc/tests/config/testdata/configs/parsecppcomments_false.qdocconf
- A src/qdoc/qdoc/tests/config/testdata/configs/parsecppcomments_false_moduleheader_nonempty.qdocconf
- A src/qdoc/qdoc/tests/config/testdata/configs/parsecppcomments_moduleheader_empty.qdocconf
- A src/qdoc/qdoc/tests/config/testdata/configs/parsecppcomments_moduleheader_nonempty.qdocconf
- A src/qdoc/qdoc/tests/config/testdata/configs/parsecppcomments_true.qdocconf
- A src/qdoc/qdoc/tests/config/testdata/configs/parsecppcomments_true_moduleheader_empty.qdocconf
- M src/qdoc/qdoc/tests/config/tst_config.cpp