一杯清酒邀明月
天下本无事,庸人扰之而烦耳。

QRadioButton 选中的方法比较简单:

ui->radioButton->setChecked(true);

 取消选中怎么办?如果单纯使用:

ui->radioButton->setChecked(false);

 你会发现,然并卵...

实际上,有效的方法之一,你可以尝试如下做法:

1 ui->radioButton->setAutoExclusive(false);
2 ui->radioButton->setChecked(false);
3 ui->radioButton->setAutoExclusive(true);

 

posted on 2022-06-01 15:29  一杯清酒邀明月  阅读(3336)  评论(1)    收藏  举报