获取QRadioButton的值

radioButton多选一,并获取当前选择的是哪一个radioButton。


QButtonGroup getThreeFucSelect;

ui->radioButton_doorThreeFun0->setChecked(true);
    getThreeFucSelect.addButton(ui->radioButton_doorThreeFun0,0);
    getThreeFucSelect.addButton(ui->radioButton_doorThreeFun1,1);
    getThreeFucSelect.addButton(ui->radioButton_doorThreeFun2,2);
    getThreeFucSelect.addButton(ui->radioButton_doorThreeFun3,3);

int doorProperty_23 = getThreeFucSelect.checkedId();



你可能感兴趣的:(QT,C++)