Customize page number when printing a QTextDocument
-
25-09-2019 - |
Question
I'm trying to print the content of a QTextEdit
. For that I'm using QTextDocument::print(QPrinter*)
. Doing that, a page number is automatically added at the right bottom of the page.
Is there any way to change its format / move it / get rid of it?
Thanks.
Solution
As far as I know that is hard coded into Qt, so you can't change it.
Have a look at QTBUG-1688. There you see that this fact has already been reported, but they don't seem to work on it. So you will have to do it yourself, I think.
OTHER TIPS
If you need that, there is an way. You can use
void QTextDocument::drawContents ( QPainter * p, const QRectF & rect = QRectF() )
Add your desired footer using this.. Obviously it isn't a good one but if you need it for sure, make use of it.
I haven't give a try though. But it should work.