Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.8.1
-
None
-
Windows 11
Qt 6.8.1
Description
Hello. There is a bug with QPdfWriter, QPainter, QTextDocument. Basically, I'm creating QPdfWriter and QTextDocument with HTML. Than I'm creating QPainter and using QTextDocument::drawContents method. This results in valid PDF file, but all texts in it always stays white. Text becames black only when I'm using QTextDocument::print method. I tried to tweak QTextDocument blocks text foreground color, set up QPalette on QTextDocument & globally, setting QPen & QBrush on QPainter - nothing works to make text black. I could produce black text only with manual QPainter calls, like QPainter::drawText. I will also attach a simplified version of my code where problem persists. Thank you.