将代码复制进QRadioButton的样式表
'效果:
代码:
QRadioButton{
font:75 9pt "Arial";
background:transparent;
color:white;
border:none;
}
QRadioButton:disabled{
color:gray;
}
QRadioButton::indicator{
width:12px;
height:12px;
border-radius:8px;
}
QRadioButton::indicator:checked{
width:14px;
height:14px;
background-color:qradialgradient(spread:pad, cx:0.5, cy:0.5, radius:0.5, fx:0.5, fy:0.5, stop:0 rgba(4, 156, 232, 255), stop:0.6 rgba(4, 156, 232, 255), stop:0.65 transparent, stop:0.8 transparent, stop:0.85 rgba(4, 156, 232, 255), stop:1 rgba(4, 156, 232, 255));
border:1px solid rgb(4, 156, 232);
border-radius:8px;
}
QRadioButton::indicator:unchecked{
background-color:transparent;
border:2px solid rgba(4, 156, 232, 255);
}
QRadioButton::indicator:unchecked:disabled{
background-color:qradialgradient(spread:pad, cx:0.5, cy:0.5, radius:0.5, fx:0.5, fy:0.5, stop:0 transparent, stop:0.6 transparent, stop:0.65 transparent, stop:0.8 transparent, stop:0.85 gray, stop:1 gray);
border:2px solid rgb(200, 200, 200);
}
QRadioButton::indicator:checked:disabled{
width:14px;
height:14px;
background-color:qradialgradient(spread:pad, cx:0.5, cy:0.5, radius:0.5, fx:0.5, fy:0.5, stop:0 gray, stop:0.6 gray, stop:0.65 transparent, stop:0.8 transparent, stop:0.85 gray, stop:1 gray);
border:1px solid gray;
border-radius:8px;
}