Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Painting with QPrintPreviewWidget - different results on Windows, Linux and Mac

Painting with QPrintPreviewWidget - different results on Windows, Linux and Mac

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 580 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    nando76
    wrote on last edited by
    #1

    Hi,
    i want to paint a rectangle of 100mm x 100mm on a QPainter (or printer or what else)
    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?) but same code
    on linux and mac works as expected ( rectangle at 0,0 starts direct 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));
    

    }
    @

    The result differs on each machine. Only some pixels but it's not equal as expected.

    Any ideas whats going on here?

    Greetings
    Nando

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved