代码拉取完成,页面将自动刷新
同步操作将从 嵌入式研发部/CaseBoxServer 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#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);
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。