Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-119003

QPrinter fullPage mode behaves differently on Windows than on Mac and Linux

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P3: Somewhat important
    • 6.8.0 FF
    • 6.7
    • GUI: Printing
    • 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

          For Gerrit Dashboard: QTBUG-119003
          # Subject Branch Project Status CR V

          Activity

            People

              vgt Eirik Aavitsland
              vgt Eirik Aavitsland
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes