PDA

View Full Version : how to set opacity to a shadow for a widget



ginu
2nd August 2012, 10:56
Hello,
i have a QPushButton . To enable shadow for this, i have done the following:

QGraphicsDropShadowEffect* effect = new QGraphicsDropShadowEffect();

button->setGraphicsEffect(effect);

Here 'button' is my custom control derived from QPushButton.

It works.

Now I also need to add opacity to the shadow part only.

How to achieve this?

Any help would be useful.

spirit
2nd August 2012, 11:00
Did you try to use fourth parameter of QColor (it's alpha)?