Set text in QTextDocument
-
Hi
I want to set the text as it is in the image using QTextDocument (I generate PDF from this object).
At first I have HTML formatted text but I dont know how to set the text in this position.
Its my text in HTML:
QString html = "<div><div align=right>String1</div><div align=left>String2</div></div>";
-
@ppitu said in Set text in QTextDocument:
QTextDocument
How you render your textDocument ? Normally you use a Painter like this :
textDocument.drawContents(&painter);Your html will be render into painter, and use painter to Print in PDF file.
-
Hi,
QTextDocument does not support the full html specification especially with regard to CSS.
If you need that then you should check the web engine module.
-
Hi,
QTextDocument does not support the full html specification especially with regard to CSS.
If you need that then you should check the web engine module.