组框内的单选底部将被视为一组底部。它们是互斥的。我怎样才能清理他们的检查状态?
我有几个收音机底部,其中一个是检查过的。我怎样才能“清理”(取消选中)所有收音机底部?“setChecked”在组内不起作用,我尝试做以下事情但失败了。
我的代码如下,radioButtom 在 groupBox 内,我想取消选中它。第一个 setChecked 确实有效,但第二个无效,radioBottom 没有被取消选中
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
QRadioButton *radioButton;
ui->setupUi(this);
radioButton->setChecked(true);
radioButton->setChecked(false);
}
我的代码中的问题在哪里?