QDoc: Add support for overriding languages of quoted files
The \snippet, \quotefile and \quotefromfile commands rely on the file
name passed to them to determine the code marker to use for marking up
text. It can be useful to override this, particularly when QDoc does
not support the language being quoted.
This change brings these commands in line with the \code command,
accepting an optional language argument on the same line as the command
itself. Language information is retained for use by generators and other
tools in the production process.
Pick-to: 6.11 6.11.0
Fixes: QTBUG-106488
Change-Id: Ic55be0bf3c3ffbee58dd6da7127eb0ad5fe97dc7
Reviewed-by: Topi Reinio <topi.reinio@qt.io>
| commit | 47d4231c62b80c7c23d01df35909dfed0232374e |
| parent | ccc018b81b46b3f48a24d1b9d57636a39de0b900 |
| author | David Boddie <david.boddie@qt.io> |
| committer | David Boddie <david.boddie@qt.io> |
| commit time | Mon, 2 Mar 2026 13:14:40 +0100 |
- M src/qdoc/qdoc/doc/qdoc-manual-markupcmds.qdoc
- M src/qdoc/qdoc/src/qdoc/doc.cpp
- M src/qdoc/qdoc/src/qdoc/doc.h
- M src/qdoc/qdoc/src/qdoc/docparser.cpp
- M src/qdoc/qdoc/src/qdoc/docparser.h
- M src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/code_languages/code_languages.qdocconf
- M src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/code_languages/expected/docbook/index.xml
- M src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/code_languages/expected/html/CodeLanguages-qdoc-warnings.log
- M src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/code_languages/expected/html/codelanguages.index
- M src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/code_languages/expected/html/index.html
- M src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/code_languages/expected/webxml/index.webxml
- A src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/code_languages/src/code.cpp
- A src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/code_languages/src/code.py
- M src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/code_languages/src/index.qdoc