I need to apply Glow effect to QLabel
. Text in Black color and glow effect in white(Stroke Effect). I tried in Google but no luck.
If any one knows how apply Glow effect to QLabel
then please tell me How to do that.
I need to apply Glow effect to QLabel
. Text in Black color and glow effect in white(Stroke Effect). I tried in Google but no luck.
If any one knows how apply Glow effect to QLabel
then please tell me How to do that.
Yes you can set it on a QLabel
:
http://qt-project.org/doc/qt-5/qwidget.html#setGraphicsEffect
You can set a QGraphicsEffect on a widget, as long as you don't mind it not working on a Mac.
label = new QLabel("hello text"));
QGraphicsDropShadowEffect * dse = new QGraphicsDropShadowEffect();
dse->setBlurRadius(10);
label->setGraphicsEffect(dse);
Hope that helps.
I think you're going to be slightly disappointed. To apply an effect, you'll need to use a QGraphicsItem. QLabel isn't. You'll need to use a QGraphicsTextItem inside a QGraphicsScene instead. That probably means you'll need to rebuild your UI if it's already implemented using QWidgets.