[Qt-interest] QPrinter and QPainter transforms

James Vernon jamesv at zepler.org
Mon Feb 9 21:17:25 CET 2009


Hi all,

I'm trying to print the contents of a QGraphicsScene to paper using
QPainter and QPrinter. In the scene's QGraphicsView, I mirror the view
in the x or y axis by applying a matrix transform.  My problem is that
when I render the scene with a QPainter, I want to apply the same
reflection matrix from the view to the painter with the setMatrix()
method, but doing so causes the visible items to be rendered off the
printable area of the page.

I've tried grabbing the painter window() and viewport(), multiplying
them by the reflection matrix and saving them back to the painter, but
that doesn't seem to be helping. How should I be getting and setting
the viewable/printable area of the page?

Thanks,
James



More information about the Qt-interest-old mailing list