Qt登录对话框

QString c_user,c_password;
c_user=CLoginUi->m_user->text().trimmed();
c_password=CLoginUi->m_password->text().trimmed();
if(c_user!=NULL&&c_password!=NULL)
{
QSqlQuery query;
query.prepare("select * from tb_operator where name='"+c_user+"'and password='"+c_password+"'");
query.exec();
if(query.next())
{accept();}
else
{
QMessageBox::warning(this,tr("Warning"),tr("The User Or Password error!"),QMessageBox::Yes);
CLoginUi->m_password->clear();
}
}

posted @ 2015-09-02 02:59  陈泉宏  阅读(282)  评论(0编辑  收藏  举报