Bug 207216 - Oxygen style mishandles background transparency
Summary: Oxygen style mishandles background transparency
Status: RESOLVED FIXED
Alias: None
Product: Oxygen
Classification: Plasma
Component: style (show other bugs)
Version: unspecified
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: Camilla Boemann
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-13 00:48 UTC by Steven M. Parrish
Modified: 2009-12-07 18:54 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Sample code to show the bug (684 bytes, text/x-c++src)
2009-09-13 07:54 UTC, Craig Scott
Details
Screenshot of the incorrectly rendered result (10.04 KB, image/png)
2009-09-13 07:54 UTC, Craig Scott
Details
Fixed background rendering when base color has alpha channel (82.35 KB, image/png)
2009-10-18 21:52 UTC, Hugo Pereira Da Costa
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Steven M. Parrish 2009-09-13 00:48:54 UTC
Version:            (using KDE 4.3.1)
OS:                Linux
Installed from:    Fedora RPMs

Description of problem:
When the Oxygen style is being used, transparent backgrounds for widgets are
not handled correctly. Undesirable artefacts are shown and transparency is not
always enforced. Sample code is attached and I'll also attach a screen shot
shortly. Using any other style works as expected, so the problem seems to be
restricted to the Oxygen style. I have had correspondence with Nokia on this
issue and we agree that the Oxygen style appears to be the cause.

Version-Release number of selected component (if applicable):
The bug only shows up for Qt4.4.1 and later. When using Qt4.4.0 the bug does
not seem to show up.

How reproducible:
See attached code sample and screen shot.

Actual/expected results:
The sample code should show a light green box with QLabel text drawn over it.
The bug instead causes a dark green box to be drawn partly over the light green
box and the label never appears. Other manifestations of the bug show a black
box instead, but the general behavior seems to be that a darker box seems to
cover approximately the upper half of the widget and transparency is
mishandled.
Comment 1 Craig Scott 2009-09-13 07:54:11 UTC
Created attachment 36913 [details]
Sample code to show the bug
Comment 2 Craig Scott 2009-09-13 07:54:42 UTC
Created attachment 36914 [details]
Screenshot of the incorrectly rendered result
Comment 3 Hugo Pereira Da Costa 2009-10-18 20:07:02 UTC
There are two issues here:
1/ the gradient, if shown, is not rendered properly. I believe this is because the alpha channel of the widget background color is not properly accounted for when calculating the gradients. This can probably be fixed for kde4.4

2/ there should not be any gradient here anyway. This one might be a Qt bug. The thing is that your widget is assigned a Qt::Window flag (which triggers the gradient painting) (Note: thanks Casper for the clue where to look), because it has no parent, even if it gets embedded into a graphicsScene. This is a Qt decision/bug/feature (I don't know). We can either 
- file a Qt bug
- try make the triggering of background gradient rendering more strict to detect cases above (but that might then break other things)
- let you add a parent to your widget :-)
Comments welcome.

Let me try fix 1/ first ...
Comment 4 Hugo Pereira Da Costa 2009-10-18 21:50:24 UTC
ok. So item 1/ above is fixed (see attachment). 
For Item 2/ I'm not sure how to address.
Comment 5 Hugo Pereira Da Costa 2009-10-18 21:52:17 UTC
Created attachment 37653 [details]
Fixed background rendering when base color has alpha channel