It seems that the DT policy is to render all known text files as raw text regardless of extension, and to only use QuickLook plugins for files which are not known to be text. Would it be possible to override that behavior and allow the use of QuickLook for specific extensions (such as .cpp, .h, …)?
I sometimes put source code snippets into DT, and I also use a QuickLook plugin which does source code syntax highlighting (GitHub - sbarex/SourceCodeSyntaxHighlight: Quick Look extension for highlight source code files on macOS 10.15 and later.). I never want to edit these snippets inside DT and would prefer to have DT render them through this QuickLook plugin.
The obvious place for this option would be “Menu → View → Document Display → Best Alternative” but this seems to be disabled for all text-based files.
There is also an “AdditionalPlainTextExtensions” hidden preference. What I have in mind would be the opposite of that – take a known text extension and make it effectively unknown to DT so that DT is forced to render it via QuickLook like it does other unknown extensions.