Hello,

The code works. In fact, I did another test: put three radio buttons in one qgroupbox. Using setChecked( true) to select one radio button. But, if I want to clear the selection, the setChecked( false ) seems not working. In following code, first radio button is selected. But it can not be unselected.

Qt Code:
  1. // main.cpp
  2. #include <QtGui>
  3.  
  4. int main(int argc, char* argv[])
  5. {
  6.  
  7. QApplication app(argc, argv);
  8.  
  9. QGroupBox *groupBox = new QGroupBox("Exclusive Radio Buttons");
  10.  
  11. QRadioButton *radio1 = new QRadioButton("&Radio button 1");
  12. QRadioButton *radio2 = new QRadioButton("R&adio button 2");
  13. QRadioButton *radio3 = new QRadioButton("Ra&dio button 3");
  14.  
  15.  
  16. QVBoxLayout *vbox = new QVBoxLayout;
  17. vbox->addWidget(radio1);
  18. vbox->addWidget(radio2);
  19. vbox->addWidget(radio3);
  20. vbox->addStretch(1);
  21. groupBox->setLayout(vbox);
  22.  
  23. groupBox->show();
  24.  
  25. radio1->setChecked(true);
  26.  
  27. radio1->setChecked(false);
  28.  
  29.  
  30. return app.exec();
  31. }
To copy to clipboard, switch view to plain text mode 

Is there any way to make no radiobutton selected?

Thank you!