PDA

View Full Version : Problem: Transparent Background with Stylesheets



dropkickz
1st June 2011, 10:53
Hi,

I have read some threads about similar problems but I couldn't find an answer for mine. What I want is to set a background color with alpha for e.g. QMenus over a stylesheet. My application has a plastique style and I compile my code for Windows as well as Mac. Now the problem. Everything works fine under Mac. There I get a menu with transparent background. The same code under Windows7 results in an opaque background of the menu. Any hints how I can solve this problem?

Regards,
Marcus

DanH
1st June 2011, 21:46
I vaguely recall that a WINDOW on Windows always has an opaque background. Will a widget work instead?

dropkickz
7th June 2011, 10:58
Hi DanH,

what do you mean by "will a widget work instead"? I can set the windowOpacity of widget to some alpha value between 0.0 and 1.0 and I get semitransparent toplevel windows. That's not the problem. What I want is a semitransparent Menu e.g. in connection with an action of my mainwindow toolbar. Therefore I set the background attribute in my stylesheet for QMenus but the alpha is only working on OSX. So what can I do to get the alpha working on Windows as well? Do I have to set some Flag to the QMenu to tell Windows that it can have transparent backgrounds?

Regards,
Marcus