PDA

View Full Version : Semi-transparency through parents' widgets



Anatoly
21st December 2009, 02:35
Hi all,
Can you help me make a widget transparent through parents' widgets. By that I mean making a widget transparent to the desktop (for example) while the parent widget is opaque.
I've tried stuff like

setStyleSheet("background-color: QColor(r,g,b,%);");
setAttribute(Qt::WA_PaintOnScreen);
setAttribute(Qt::WA_PaintUnclipped);
but had no luck.
Thanks in advance!

yogeshgokul
21st December 2009, 06:27
Hi all,
Can you help me make a widget transparent through parents' widgets. By that I mean making a widget transparent to the desktop (for example) while the parent widget is opaque.
I've tried stuff like

setStyleSheet("background-color: QColor(r,g,b,%);");
setAttribute(Qt::WA_PaintOnScreen);
setAttribute(Qt::WA_PaintUnclipped);
but had no luck.
Thanks in advance!
Check this out
void setWindowOpacity ( qreal level ) (http://doc.trolltech.com/4.2/qwidget.html#windowOpacity-prop)

Anatoly
21st December 2009, 10:23
Check this out
void setWindowOpacity ( qreal level ) (http://doc.trolltech.com/4.2/qwidget.html#windowOpacity-prop)
Yeah, but doesn't that make the whole window transparent, including titlebar etc.? I need only the one widget to be transparent, while keeping all other stuff opaque.