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

[regression] QGraphicsScene::drawBackground() gets a QPainter with composition mode 'Source' if QGraphicsView::CacheBackground is enabled

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • None
    • 4.6.0
    • Widgets: GraphicsView
    • None

    Description

      When KDE trunk switched to Qt-4.6 we noticed that several of our games from kdegames stopped to draw background correctly.

      We figured out this is due to a QGS::drawBackground() is getting a QPainter with composition mode set to 'Source' instead of the usual 'SourceOver'.
      This happens only when view has cacheMode set to QGV::CacheBackground.

      Having a QPainter in Source mode makes it impossible to properly draw a partly transparent content in drawBackground().

      Parker came up with a simple example written in PyQt (attached) - i think you won't have any trouble converting it to C++ if needed

      Attachments

        1. drawbackground.py
          0.9 kB
        2. grover.png
          grover.png
          171 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            goffart Olivier Goffart (closed Nokia identity) (Inactive)
            dimsuz Dmitry Suzdalev
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes