1 Star 0 Fork 4

boarmy/CaseBoxServer

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
netform.cpp 1.96 KB
一键复制 编辑 原始数据 按行查看 历史
fuyaojiutian 提交于 2017-11-04 15:59 . PC端界面完成
#include "netform.h"
#include "ui_netform.h"
NetForm::NetForm(datebase *db,int ID,QWidget *parent) :
QDialog(parent),
ui(new Ui::NetForm)
{
ui->setupUi(this);
setWindowFlags(Qt::FramelessWindowHint);
net_db=db;
Net_ID=ID;
GetNetInfo();
}
NetForm::~NetForm()
{
delete ui;
}
void NetForm::paintEvent(QPaintEvent *)//
{
QPixmap pix(":/images/Sback.jpg");
QPainter painter(this);
int w = width();
int h = height();
painter.drawPixmap(0,0,w,h,pix);
}
void NetForm::on_pushButton_Quit_clicked()
{
this->close();
}
void NetForm::on_pushButton_OK_clicked()
{
NetInfo nInfo;
nInfo.Pass_No=ui->lineEdit_passNo->text();
nInfo.NetName=ui->lineEdit_name->text();
nInfo.Address=ui->lineEdit_address->text();
nInfo.Phone=ui->lineEdit_phone->text();
nInfo.Person=ui->lineEdit_person->text();
nInfo.UpSection=ui->lineEdit_section->text();
nInfo.NetFlag=ui->lineEdit_flag->text();
net_db->updateNetInfo(net_db->sqlite_db,Net_ID,&nInfo);
this->close();
}
void NetForm::GetNetInfo()
{
bool res;
QString str,pass,name,address,phone,person,section,flag;
str=QString("select Pass_No,NetName,Address,Phone,Person,UpSection,NetFlag from NetInfo where Id = %1").arg(Net_ID);
QSqlQuery query(*this->net_db->sqlite_db);
query.clear();
query.exec(str);
res=query.next();
if(res)
{
pass=query.value(0).toString();
name=query.value(1).toString();
address=query.value(2).toString();
phone=query.value(3).toString();
person=query.value(4).toString();
section=query.value(5).toString();
flag=query.value(6).toString();
ui->lineEdit_passNo->setText(pass);
ui->lineEdit_name->setText(name);
ui->lineEdit_address->setText(address);
ui->lineEdit_phone->setText(phone);
ui->lineEdit_person->setText(person);
ui->lineEdit_section->setText(section);
ui->lineEdit_flag->setText(flag);
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/boarmy/CaseBoxServer.git
git@gitee.com:boarmy/CaseBoxServer.git
boarmy
CaseBoxServer
CaseBoxServer
master

搜索帮助