Window opacity
-
Hi
I want to set the window opacity of some widgets so I started with
@
ui.buttonLabel_4->setWindowOpacity(0.0);
@
which had no effectthen 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
-
Hi,
Since button is not a window. See "windowOpacity":http://qt-project.org/doc/qt-5.0/qtwidgets/qwidget.html#windowOpacity-prop