[Interest] QPrinter::pageRect() and QPainter::drawRect() - misplaced output

Leonardo Backes leonardo.backes at gmail.com
Thu Jan 9 02:07:48 CET 2014


Hi,

I'm developing some report generator tool in my current project, using
QGraphicsView/Scene to format the pages.
All of this is done as a viewer, but when I want to print it, I got
some problems.

I've made some simple tests and came to this code
http://ideone.com/AyxJHM which, as far I understand, should draw a
rectangle within the margins limits.
The fact is it is outputing this http://imgur.com/QouMlGr (as PDF
opened on Okular).

I'm using ArchLinux. Qt 4.8.5 and Qt 5.2 output the same result.

For printing over Cups to a real printer, the result is similar.

Am I missing something with the code?

Thanks in advance.

Leonardo.



More information about the Interest mailing list