I want to draw a circle on a widget and within the circle background screen should be visible i.e. just border/circumference of circle should be visible on the widget.
Rest of the widget should be transparent.
I have tried :
1) setStyleSheet("background:transparent;")
2) setAttribute( Qt::WA_TranslucentBackground, true );
3) Overriding paintEvent(QPaintEvent* event);
All of the above methode didn't work. and setAutoFillBackground() is false. I am new to Qt and above solution I just found on google. Please Help.
The QWidget::setMask
function, if used on the window, will have that affect. See also the shaped clock example (also referenced from the setMask
documentation).