[Interest] QPixmap in QGraphicsView: "visual noise" with transparency [OS X]?

Till Oliver Knoll till.oliver.knoll at gmail.com
Mon Aug 27 08:48:31 CEST 2012


I create a QPixmap and fill(QPixmap::fill)  it with Qt::transparent. I then draw with a QPainter a QImage (with alpha channel/transparency) into it. I then set that QPixmap in QGraphicsPixmapItem.

However "visual noise" (stripes, random pixels, garbage, ...) appears in the areas which should be fully transparent, as if they weren't initialised.

The same happens with both the "native" and "raster" (even more garbage) paint engine with Qt 4.8.2 on OS X 10.8 Mountain Lion (haven't tried Snow Leopard 10.6 yet...).

The workaround is to fill a QImage first, paint everything in there and then convert that into the final QPixmap, but I thought I could save that step.

Anyone else observed this? Am I not supposed to fill a QPixmap with Qt::transparent? Is painting into a QImage (including costly conversion to QPixmap afterwards) the preferred way anyway?

  Cheers, Oliver

More information about the Interest mailing list