I have tried creating a smooth rounded corners of a widget using method described below:
Qt::Window | Qt::FramelessWindowHint
and
Qt::WA_TranslucentBackground
flag;QFrame
inside of a widget;QFrame
, for example:border: 1px solid red; border-radius: 20px; background-color: black;
I was able to attain the smooth rounded corners but the widget is "window" type so i am not able to position the widget according to other widgets. Can we attain the complete transparency of a widget by not making the widget as "window" type?
We can make button widget as complete circular shape(Android& iOS). Set border as 1 and select style as 'complete rounded corner', provided you have given equal height and width to the widget.
Rounded Corners Make Information Easier to ProcessSharp corners throw your eyes off the path of the line so you end up experiencing abrupt pauses when the line changes direction. But with rounded corners, the line leads your eyes around each corner to continue along the path smoothly.
Corner radius rounds the corner where two lines meet. Use this to create shapes with rounded corners. Corner smoothing adjusts a rounded corner to create a continuous curve.
Your question is quite unclear. It sounds to me like this is a widget you want to add to a layout. If you want a widget with rounded corners, just use a QFrame
and set a style-sheet to it:
myFrame->setStyleSheet(".QFrame{background-color: red; border: 1px solid black; border-radius: 10px;}");
There is no need to create a widget that contains a QFrame
. Just use QFrame
directly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With