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

QPainter OSX HIDPI scaling on single pixel cosmetic lines

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Out of scope
    • Icon: Not Evaluated Not Evaluated
    • None
    • 4.8.4
    • GUI: Painting
    • None
    • Qt 4.8.4, OSX 10.8.2
    • macOS

      When drawing a 1.0 width cosmetic line on a Retina display, one would expect that line to occupy 2 real screen pixels, based on the 2x scale factor purportedly in use in Qt 4.8.4. The attached file and enlarged screen capture show that a 1.0 width cosmetic line is rendered with an actual 3 screen pixel width (the black line overlay is to make it easier to count).

      QPainter.fillRect seems to not be effected by this, and so code which draws a line to the right of a filled rect will overlap by 1 screen pixel on a retina display.

      On a more subjective note, the width of 3 screen pixels looks far too large for single-width line. Adjusting the pen width to ~0.55 will yield the expected 2 screen pixel width in some, but not all cases. This looks much better, but is non portable.

        1. linebug_pixie.png
          linebug_pixie.png
          117 kB
        2. linebug_tableview.png
          linebug_tableview.png
          149 kB
        3. linebug.png
          linebug.png
          5 kB
        4. main.cpp
          0.5 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            sorvig Morten Sørvig
            sccolbert Chris Colbert
            Votes:
            3 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes