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

QGraphicsScene background caching does not work well with Windows fractional scaling

XMLWordPrintable

    • Windows

      A minimal reproducer that is adapted from "diagram scene" example is attached. Build and run, then scroll around, one will see "tearing":

      If the screen is scaled, e.g. by 125% or 150%.

      That is due to

      view->setCacheMode(QGraphicsView::CacheBackground);
      

      Without caching, the problem is gone.

      Plus, "setDevicePixelRatio" does not help here. Tearing still happens no matter if QPixmap knows the correct pixel ratio or not.

      What original reporter suspects:
      The fundamental issue is that the cached background is a pixmap and it can only be shifted full pixels, where as the backgrond drawing happens to subpixel accuracy to the same backbuffer.

        1. image-2025-08-07-18-26-52-435.png
          18 kB
          Luqiao Chen
        2. QTBUG-139010.7z
          1.0 kB
          Luqiao Chen
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            bibr Andreas Aardal Hanssen
            luqiaochen Luqiao Chen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes