set transparent background for custom widget is not effective
hello, I made a custom widget named PopUpIrregularWidget, I want to make this customed widget has transparent background, and I use the code
Code:
this->setStyleSheet("PopUpIrregularWidget{background : transparent;}");
, but the background is white, not transparent.
So how to make the custom widget background transparent?
or I lost something ?
Re: set transparent background for custom widget is not effective
What is PopUpIrregularWidget? Base class? Have you reimp the paint event? Try to use QPalette.
Re: set transparent background for custom widget is not effective
The PopUpIrregularWidget just extends QWidget, a custom QWidget.And I use the code
Code:
style
()->drawPrimitive
(QStyle::PE_Widget,
&opt,
&painter,
this);
in the paintEvent.