单选框, 复选框
Widget::Widget(QWidget *parent)
: QWidget(parent)
, ui(new Ui::Widget)
{
ui->setupUi(this);
//单选框
ui->RDB_Men->setChecked(true); //设置默认属性
connect(ui->RDB_Women,&QRadioButton::clicked,[=](){
qDebug() << "选中女";
});
//多选框,选中为2,未选中为0,半选中为1
connect(ui->checkBox,&QCheckBox::stateChanged,[=](int state){
qDebug() << state;
});
}