QGridLayout *layout = new QGridLayout;box =new QCheckBox();box->setText("复选框");box1 =new QCheckBox();box1->setText("&C复选框1");box1->setDisabled(true);layout->addWidget(box,0,0);layout->addWidget(box1,0,1);connect(box,SIGNAL(stateChanged(int)),this,SLOT(ShowLog(int)));connect(box1,SIGNAL(stateChanged(int)),this,SLOT(ShowLog(int)));ui->centralWidget->setLayout(layout);void MainWindow::ShowLog(int state) {qDebug()<<state<<" "<<box->isChecked()<<" "<<box->isTristate();if(state)box1->setEnabled(true);elsebox1->setEnabled(false); }