1.qt designer设计师,将enabled取消
2.PushButton继承的QAbstractButton然后继承Widget,享有两者方法
槽函数:
ui->pushButton->setEnable(false); //禁用
ui->pushButton->setDisable(true); //禁用
槽函数:
ui->pushButton->setEnable(false); //禁用
ui->pushButton->setDisable(true); //禁用