3 Star 2 Fork 4

嵌入式研发部/CaseBoxServer

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
userform.cpp 1.64 KB
一键复制 编辑 原始数据 按行查看 历史
#include "userform.h"
#include "ui_userform.h"
UserForm::UserForm(datebase *db,int ID,QWidget *parent) :
QDialog(parent),
ui(new Ui::UserForm)
{
ui->setupUi(this);
setWindowFlags(Qt::FramelessWindowHint);
User_db=db;
User_ID=ID;
ui->lineEdit_PerM_Pass->setEchoMode(QLineEdit::Password);
ui->lineEdit_PerM_Pass_Second->setEchoMode(QLineEdit::Password);
GetUserInfo();
}
UserForm::~UserForm()
{
delete ui;
}
void UserForm::paintEvent(QPaintEvent *)//背景
{
QPixmap pix(":/images/Sback.jpg");
QPainter painter(this);
int w = width();
int h = height();
painter.drawPixmap(0,0,w,h,pix);
}
void UserForm::GetUserInfo()
{
bool res;
QString str,user;
str=QString("select User from UserSys where Id = '%1'").arg(User_ID);
QSqlQuery query(*this->User_db->sqlite_db);
query.clear();
query.exec(str);
res=query.next();
if(res)
{
user=query.value(0).toString();
ui->lineEdit_PerM_User->setText(user);
}
}
void UserForm::on_pushButton_Quit_clicked()
{
this->close();
}
void UserForm::on_pushButton_OK_clicked()
{
QString pass,passSecond,user;
pass=ui->lineEdit_PerM_Pass->text().trimmed();
passSecond=ui->lineEdit_PerM_Pass_Second->text().trimmed();
if(pass.isEmpty() || passSecond.isEmpty())
{
QMessageBox::information(this,tr("提示"),tr("密码为空"));
return;
}
if(pass != passSecond)
{
QMessageBox::information(this,tr("提示"),tr("密码不一致"));
return ;
}
user=ui->lineEdit_PerM_User->text().trimmed();
User_db->updateUserInfo(User_db->sqlite_db,User_ID,user,pass);
this->close();
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/gzembedded/CaseBoxServer.git
git@gitee.com:gzembedded/CaseBoxServer.git
gzembedded
CaseBoxServer
CaseBoxServer
master

搜索帮助