Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
None
-
5.10.1
-
None
Description
Starting sometime after Qt 5.7.1 calling setOpacity() on a QGraphicsPixmapItem stopped producing the expected result for OS X:
- For opacity = 1.0, the pixmap suddenly becomes completely transparent instead of opaque.
- For 0 < opacity < 1, the pixmap is partially visible as expected, but the desktop behind the Qt app is visible instead of a fully opaque QGraphicsRectItem that was placed behind it.
Using OS X 10.12.6. This issue does not occur on Linux or Windows, just OS X. Attached screenshot of opacity 0.5 for windows/linux vs OS X.
// Opaque QGraphicsRectItem behind QGraphicsPixmapItem QColor background_color(100, 100, 100); QPen pen(background_color); QBrush brush(background_color); scene.addRect(0, 0, width, height, pen, brush); // Partially opaque QGraphicsPixmapItem QPixmap pixmap; pixmap.convertFromImage(...); QPixmap scaled_pixmap = pixmap.transformed(QTransform().scale(width_zoom, height_zoom)); QGraphicsPixmapItem* graphics_item = scene.addPixmap(scaled_pixmap); graphics_item->setOpacity(0.5); // desktop is partially visible