that's because the text document has its own painter, and you were overriding it, and it uses its own painter on the printer object you give it.
As I said, QPainter is not to be found out side of a paintEvent()!
Glad it helped!