在登陆界面中写用户名和密码编译时出现“accept”was not declared in this scope 的错误
void Widget::on_login_clicked()
{
// qDebug("登录被点击了");
// cout<<"login"<<end1;
if(ui->lineEdit->text()=="username"&&ui->lineEdit_2->text()=="123456")
accept();
else
{QMessageBox::warning(this,("Warning"),"用户名或密码错误!",QMessageBox::Yes);
ui->lineEdit->clear();
ui->lineEdit_2->clear();
ui->lineEdit_2->setFocus();
}
}