Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.4.0
-
Qt Creator, Windows 7 x32, Linux
-
9e81fb4df6809bb2ff909af595ac9e2487760181
Description
Critical regression that breaks almost everything into my application was introduced by Qt 5.4.
QWidget::grab() has 2 issues.
I have a label with a PNG with alpha set as QLabel's pixmap.
In 5.3, label.grab() returns the pixmap with the proper alpha set in it, and if I save it, the alpha is there. In 5.4, alpha is completely ignored, and grabbed image is opaque.
Then, I set QGraphicsEffect on this QLabel. label.grab() then returns completely empty transparent image. In qt 5.3, the image returned was original translucent image with QGraphicsEffect applied to it (and its alpha there)
Given the very bad design decision for QGraphicsEffect itself and the grab() regression, I am now unable to generate translucent images with drop-shadows unless I implement convolution kernel filter by myself, which I want to avoid at all costs! As a side feature request, app QGraphicsEffect::ApplyToPixmap / ApplyToImage API so we can use these great effects on something different than QWidgets / QGraphicsViews. Nor I can hack the draw() call on the QGraphicsEffects, because sourcePixmap() call should actually was argument to the draw call (Design flaw by itself)
You should also add an unit test for grabbing translucent pixmaps from QWidget with QGraphicsEffect set.
For now, this issue is MAJOR SHOWSTOPPER here and I will return to 5.3 immediately.
Attached is example project
Attachments
Issue Links
- resulted from
-
QTBUG-26564 All child widgets not rendered to PDF
- Closed
For Gerrit Dashboard: QTBUG-43968 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
126179,2 | Make QWidget::grab work with graphics effects | 5.6 | qt/qtbase | Status: MERGED | +2 | 0 |