PDA

View Full Version : QWidget, QFrame and QDialog transparency



JonnyJP
9th February 2012, 18:09
Hi, just a quick question.

If I set my QFrame or QDialog stylesheet to include
background-color:rgba(0,0,0,100); and those objects have a parent, they are rendered with a semi-transparent black background which is fine.

If I set my QWidget to have that stylesheet then the background is opaque.

So I'm just wondering:


What properties do those classes have that allows the alpha channel to work?
Why is a parent needed for transparency?


I'm not struggling with the code, just wondering that's all

Spitfire
13th February 2012, 17:30
Parent isn't needed for transparency, but then you need translucent background attribute and frameless window hint set on that widget.
Look up Qt::WA_TranslucentBackground in the documentation for more info.

JonnyJP
16th February 2012, 17:13
Cheers, I'll have a look at this also