Aligning text using QTextDocument
-
I'm using QTextDocument to put text into a QPixMap so it can go onto a QPushButton.
I use the following methods: setPageSize, setHtml and drawContents. Everything works fine except that the text is left justified. I've looked over the methods for QTextDocument, but I can't find anything that would let me change the alignment to right justified. Which method should I be using?
-
Hi,
You might be looking for "QTextBlockFormat::setAlignment":http://doc.qt.io/qt-5/qtextblockformat.html#setAlignment
Hope it helps