Search code examples
qtqt5

How clear all checkboxs and radiobuttons with a pushbutton in Qt?


enter image description here

I want when pushing the clear all choices button, all checkboxes and radio buttons are be unchecked.


Solution

  • void MainWindow::on_pushButton_clicked()
    {
        ui->checkBox->setChecked(false);
        ui->radioButton->setChecked(false);
        // Add all other check boxes and radio buttons you have...
    }