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

QPainter rotate causes pixmap rendering issues

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 6.0.1
    • Fix Version/s: 5.15.5, 6.1.1, 6.2.0 Alpha
    • Component/s: GUI: Painting
    • Labels:
      None
    • Environment:
      Tested on Windos 10 and an unknown linux distro
    • Platform/s:
      Linux/X11, Windows
    • Commits:
      ddc5af9f17474129223c7bbac58b57bb3ed0ff74 (qt/qtbase/dev) a22acb8ba59285219a1e57d403ecd865936255e4 (qt/qtbase/6.1) 84a9676fb6e398fcccf4cf1fb911d232939a258b (qt/tqtc-qtbase/5.15)

      Description

      When transforming the QPainter, rotating and drawing a qpixmap or QImage will sometimes fail to draw anything to the painter. When calling fillrect with the rect of the image or pixmap, the pixels are clearly filled as expected.

      Images and GIF available at https://stackoverflow.com/questions/67099367/qpainter-rotation-prevents-correct-qpixmap-rendering/67360005

      Minimal reproducable code example attached, to see the issue, scroll the mose wheel to "zoom out" then click and drag the left mouse button around inside the window to pan the view around, it will be extremely obvious when the bug occurs, as many or all of the squares will disappear unexpectedly.

       

      Commenting out the single line which rotates the QPainter fixes the issue (well not fixed because my pixmaps aren't rotated, but you get my point!), also changing the angle of the rotation, and even the range of different angles that can be assigned to a square,  changes the manifestation of the rendering issue.

        Attachments

          Issue Links

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

            Activity

              People

              Assignee:
              allan.jensen Allan Sandfeld Jensen
              Reporter:
              troyseph Sebastian Troy
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes