PDA

View Full Version : QPainter(&QPrinter) & QPainter(&QImage) communication



gufeatza
1st February 2010, 15:08
Hello everybody. Please hear me out... :)

I declare a QPainter over a QPrinter and draw some images, some text, it doesn't matter.
I also would like to have an option to save the specific content as an image (.png, .img).

Here comes my problem:

When printing to the printer, I apply to QPrinter object some properties, such as page orientation, page size, etc.
Afterward when I try to print over a QImage the same thing, I must declare a QPainter(&QImage).
What must I do to keep QPainter's properties (page orientation.. as I mentioned upper) over the QImage, so that
the saved file will have the same properties (or how can I take those properties from the QPrinter's QPainter object).

Thanks a lot

wysota
1st February 2010, 15:54
You can try calling QPainter::begin() on the other paint device but logically this will reset the transformations too.

gufeatza
2nd February 2010, 07:25
Yap you're right, properties are being reset. :(