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

QPainter antialiasing draws differently on QImage and QWidget

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P3: Somewhat important
    • None
    • 6.1.2
    • GUI: Painting
    • None
    • Linux/X11

    Description

      We are currently getting a different result when using the same QPainter calls on QImage versus QWidget. This is problematic for us because we want to use QImage for caching (and also benefit from QPainter drawing in a separate thread).
      The difference we see is the following:

      • When drawing lines with QPainter to QWidget with Antialiasing on, the lines are drawn smoothly, and in the color, we set for QPainter - the lines are all plain white in our example. This is what we expect.
      • When drawing lines with QPainter to QImage with Antialiasing on, the lines are drawn smoothly, but they seem to get mixed with the color from the background - the lines are all grey in our example. This is not what we expect.

      (In code there are two commented calls to fillWhite())

      This is an oversimplified example of course, but how can the correct result be achieved with antialiasing turned on and drawing lines?

       

      Attachments

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

        Activity

          People

            vgt Eirik Aavitsland
            friendnick Mykola Vankovych
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes