Translucent window with child widgets has darker areas?
-
Created a translucent window with rounded corners by setting
Qt::WA_TranslucentBackground
attribute and overriding paint event of the window and drawing rounded rect using a Brush with opacity set to 200.It draws fine and is transparent, the problem starts when I add child widgets to this window i.e. label, combobox etc. Sometimes the window draws fine and is semi-transparent while the controls are opaque (as I want). Other times there are horizontal areas of darker background around some of the widgets. Darker color is basically darker version of whatever color I use for window.
To me this implies that the area behind widgets is getting painted multiple times and alpha-blending is resulting in it getting darker. None of the examples I see online exhibit this, so confused how to avoid this?