Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
5.3.2, 5.4.0 RC
-
None
-
Windows 8.1
Qt 5.2.1, 5.3.2 and 5.5 (dev)
-
593e3f2fbb324f076e4d3f05b269f21f8c3ca403
Description
When you print with a dpi setting different from the dpi setting of the default printer, QPrinter::width() and height() return values as if the dpi setting of the default printer was used.
tl;dr:
1. start attached program (with Qt 5.3 or higher)
2. press print
3. change dpi to a higher value or select another printer with a different dpi setting
4. QPrinter::pageRect(QPrinter::DevicePixel) and QPaintDevice::width() and height() should return the same size, which they don't
I attached a small test program which demonstrates this issue.
In my case my default printer is set to 600dpi.
In the print preview the returned size is 4958x7017.
If I print without changing anything the size stays the same.
But when I change the dpi setting in the print dialog or select another printer with a different dpi setting (The dpi setting has to be different from the default dpi setting that was active after starting the program) the size still returns 4958x7017 while pageRect(QPrinter::DevicePixel) returns 9917x14033.