[Interest] Setting Widget opacity

Graham Labdon Graham.Labdon at avalonsciences.com
Tue Nov 26 10:20:05 CET 2013


Hi
I want to set the window opacity of some widgets so I started with

ui.buttonLabel_4->setWindowOpacity(0.0);

which had no effect

then I tried

QGraphicsOpacityEffect* opacityEffect = new QGraphicsOpacityEffect(this); // make sure to create using new, since effect has to be alive as long as the target widget is using it.
opacityEffect->setOpacity(0.0); // initially widget should be visible
ui.buttonLabel_4->setGraphicsEffect(opacityEffect);

which has the desired effect.

My question is why did my first option not work?

Thanks

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20131126/139ebbb7/attachment.html>


More information about the Interest mailing list