QRadioButton 选中的方法比较简单:
ui->radioButton->setChecked(true);
取消选中怎么办?如果单纯使用:
ui->radioButton->setChecked(false);
你会发现,然并卵...
实际上,有效的方法之一,你可以尝试如下做法:
ui->radioButton->setAutoExclusive(false);
ui->radioButton->setChecked(false);
ui->radioButton->setAutoExclusive(true);