-
Suggestion
-
Resolution: Unresolved
-
Not Evaluated
-
None
-
6.9.1
-
Windows 11
With dark mode enabled, using QTextDocument::drawContents() to get a PDF report result white text on white background. If the PDF report is created calling QTextDocument::print() then the result is black text on white background as expected.
drawContents() is used instead of print() to add headers and footers including the page numbering.
It seems that for print() the text color for the used palette is explicitly set to Qt::black. Where for drawContents() the system palette is used. And for dark mode this doesn’t work correctly.
Attached example can be used to reproduce the issue.
As a workaround, the color for the application can be changed right before calling drawContents and then set it back after that.