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

QPainter rotate causes pixmap rendering issues

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.15.5, 6.1.1, 6.2.0 Alpha
    • 6.0.1
    • GUI: Painting
    • None
    • Tested on Windos 10 and an unknown linux distro
    • Linux/X11, Windows
    • 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

          For Gerrit Dashboard: QTBUG-93475
          # Subject Branch Project Status CR V

          Activity

            People

              allan.jensen Allan Sandfeld Jensen
              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