How do I reset the border-radius?
Solved
General and Desktop
-
QString strStyle = "QFrame{border-radius:{data}px; background-color: rgba(124, 146, 166, 100);}"; strStyle.replace("{data}", QString::number((m_Size.width()-50) / 2)); this->ui.circulat_bg->setStyleSheet(strStyle);
How do I reset the border-radius?
The widget is not fixed and I want to change the size to setFixed, but is there any way to make the frame smaller depending on the size of the widget as I changed the size of the widget to the original one?
-
There's a better way to insert values to your stylesheet string :)
You don't needstring.replace
. Try
QString("QFrame{border-radius:%1px; background-color: rgba(124, 146, 166, 100);}").arg(data);
You can reset a stylesheet by passing an empty string
setStylesheet("");
But it will reset everything. Then you have to set your color again.