I am creating a custom widget my_widget
inheriting from QWidget
.
Here, I have a label to which I would like to apply QGraphicsDropShadowEffect
however it does not seem to be working since I don't see any shadows.
My code is in Python and it's:
eff = QGraphicsDropShadowEffect()
self.my_widget_label.setGraphicsEffect(eff)
I tried various alterations to this code to no avail.
After doing a through search on Google, I came across many similar questions without answers.
What might be the cause? How can I get the shadow?
See if this works for you:
I have only every tried to use this (and used it successfully) in
QGraphicsScene
situations. This works for me, while trying to set it on a normalQWidget
actually crashes the entire application:Works for me in C++. I did the following in a
QDialog
containing aQLabel
object namedtitleLabel
. I'm using Qt 4.8.4 on a Windows XP computer.