Can I un-check a group of RadioBottoms inside a group box?
Posted
by Claire Huang
on Stack Overflow
See other posts from Stack Overflow
or by Claire Huang
Published on 2010-05-12T05:24:26Z
Indexed on
2010/05/12
5:34 UTC
Read the original article
Hit count: 311
radio bottoms inside a group Box will be treated as a group of bottoms. They are mutual exclusive. How can I clean up their check states??
I have several radio bottoms, one of them are checked. How can I "clean" (uncheck) all radio bottoms?? "setChecked" doesn't work within a group, I tried to do following things but failed.
My code is as following, radioButtom is inside a groupBox, and I want to unchecked it. The first setChecked does works, but the second one doesn't, the radioBottom doesn't been unchecked
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
QRadioButton *radioButton;
ui->setupUi(this);
radioButton->setChecked(true);
radioButton->setChecked(false);
}
Where is the problem in my code?
© Stack Overflow or respective owner