QRadioButton可以通過QSS調整指示燈的樣式,具體代碼如下:
QRadioButton::indicator{ width:10px; height:10px; border-radius:5px; border-style: solid; border-width: 1px; background-color: rgb(255, 51, 33); } QRadioButton::indicator:checked { background-color: rgb(82, 158, 47); } QRadioButton::indicator:unchecked { background-color: rgb(255, 51, 33); }
調整后樣式如下圖所示: