Important: Please read the Qt Code of Conduct -

[solved] Problem of uncheck all the Radio buttons within a groupbox

  • Hi all,

    I have a groupbox with property 'checkable' equal to true. It contains 3 RadioButtons.
    I need to uncheck all RadioButtons when user unchecked the groupbox.

    So I used following method.

    @void MyPropertiesWidget::on_groupBox_toggled(bool checked)
    if (checked)

        foreach(QRadioButton *rb,ui->groupBox->findChildren<QRadioButton *>())
            qDebug() << rb->text() << rb->isChecked();


    But after going through the foreach loop it give me following results.

    "1" true
    "2" false
    "3" false

    Moreover, those 3 buttons own or a button group. It's buttonclicked SIGNAL connect to following SLOT.

    @void MyPropertiesWidget::setFactor(QAbstractButton *clicked_button)

    Can anyone help me?

    Thanks in advance...

Log in to reply