Details
-
Bug
-
Resolution: Fixed
-
P3: Somewhat important
-
6.7
-
None
-
652065b06 (dev)
Description
Setting QPrinter to fullpage mode does not itself change the reported values of the margins - they still show the default printable area.
However, on Mac and Linux, when actually painting, the margins are ignored when in fullpage mode, so the top left point of the painter is the physical top left corner of the paper. But on Windows, the margins are still obeyed, and the top left corner of the painter will by default be at the corner of the printable area.
Explicitly setting the margins to 0 works around this issue, moving the painting to physical paper corner also on Windows (while making no difference on Mac/Linux).
Attached reproducer shows this, it produces a printout with a centralized X on Linux/Mac (since the surrounding rectangle is physically unprintable on typical printers, being too close to the paper edge). While on Windows, it produces the top and left hand sides of the rectangle, inside the printable area, and an offset X that then gets clipped on the right and bottom sides.
Not sure if the one or the other is the "right" behavior here. A third option is to just document that different printing backends behave differently, so one should always set margins to 0 when enabling full-page mode.
Attachments
Issue Links
- relates to
-
QTBUG-95927 QPrinter::setFullPage does not set margins to zero
- Closed