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

QPrintPreviewWidget shows different results on Windows+Linux and Mac OS X (Mavericks)

    XMLWordPrintable

Details

    • Bug
    • Resolution: Incomplete
    • P2: Important
    • None
    • 5.2.0
    • None
    • macOS

    Description

      Try to paint a rectangle of 100 x 100 on a QPainter of a QWidget in paintEvent and display it in a QPrintPreviewWidget.

      Somehow the results on the screen differ on Windows, Linux and my MacOS X (Mavericks) machine.

      Same code has different output (same on Mac + Linux) but different on Windows.
      I paint a rectangle at position 0,0… and on Windows there is a white border (margin?)around the site, but same code
      on linux and mac works as expected ( rectangle at 0,0 starts exactly in top left corner without any margins).

      Printing and PDF export works great only the output of the pages of QPrintPreviewWidget differ.

      See a screenshot attached dispalying the output on Windows and Mac…
      See image with different results on windows and mac
      https://www.dropbox.com/s/vorgq1czurksusd/Mac-Windows-Qt5.2-QPrintPreviewWidget-Bug.png

      Then painting like this:

      void TestSite::paintEvent(QPaintEvent *)
      {
      QPainter painter(this);

      painter.fillRect(0, 0, 500,500, QBrush(Qt::red));
      }

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              johnlayt John Layt
              nando76 Nando Lambrusco
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes