Can I check the RadioBottoms group inside the group window?

radio documents within the group. The box will be considered as a group of lower parts. They mutually exclude each other. How can I clear my validation states?

I have several radio data, one of them is checked. How can I “clear” (clear) all radio data? "setChecked" does not work inside the group, I tried to do the following, but could not.

My code is this: radioButtom is inside a groupBox, and I want to disable it. The first setChecked works, but the second does not, the radio bot is not disabled

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?

+3
source share
2 answers

, autoExclusive, , .

ui->radioButton->setChecked(true);
ui->radioButton->setAutoExclusive(false);
ui->radioButton->setChecked(false);
ui->radioButton->setAutoExclusive(true);

radioButton .

+4

Qt : QRadioButton - , () ( ). " " . - ; , . AFAIK , QRadioButtons.

, QRadioButtons /. , .

, QRadioButton, , , QRadioButton , CheckCheck ( true) .

.

+1

Source: https://habr.com/ru/post/1745050/


All Articles