代码拉取完成,页面将自动刷新
同步操作将从 嵌入式研发部/CaseBoxServer 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#include "netperson.h"
#include "ui_netperson.h"
NetPerson::NetPerson(datebase *db,int ID,QWidget *parent) :
QDialog(parent),
ui(new Ui::NetPerson)
{
ui->setupUi(this);
setWindowFlags(Qt::FramelessWindowHint);
netPer_db=db;
NetPer_ID=ID;
ui->lineEdit_NetPerM_Pass->setEchoMode(QLineEdit::Password);
ui->lineEdit_NetPerM_Pass_Second->setEchoMode(QLineEdit::Password);
GetNet();
GetNetPersonInfo();
}
NetPerson::~NetPerson()
{
delete ui;
}
void NetPerson::paintEvent(QPaintEvent *)//背景
{
QPixmap pix(":/images/Sback.jpg");
QPainter painter(this);
int w = width();
int h = height();
painter.drawPixmap(0,0,w,h,pix);
}
void NetPerson::on_pushButton_Quit_clicked()
{
this->close();
}
void NetPerson::on_pushButton_OK_clicked()
{
QString address,pass,passSecond,user,flag;
pass=ui->lineEdit_NetPerM_Pass->text().trimmed();
passSecond=ui->lineEdit_NetPerM_Pass_Second->text().trimmed();
if(pass.isEmpty() || passSecond.isEmpty())
{
QMessageBox::information(this,tr("提示"),tr("密码为空"));
return;
}
if(pass != passSecond)
{
QMessageBox::information(this,tr("提示"),tr("密码不一致"));
return ;
}
address=ui->comboBox_NetPerM->currentText().trimmed();
user=ui->lineEdit_NetPerM_User->text().trimmed();
flag=ui->comboBox_NetPerM_Flag->currentText().trimmed();
netPer_db->updateNetPersonInfo(netPer_db->sqlite_db,NetPer_ID,address,user,pass,flag);
this->close();
}
void NetPerson::GetNet()
{
QSqlQuery query(*this->netPer_db->sqlite_db);
QString name;
QStringList strList;
ui->comboBox_NetPerM->clear();
query.exec(tr("select NetName from NetInfo order by Id asc"));
for(int i=0;query.next();i++){
name=query.value(0).toString();
strList<<name;
}
ui->comboBox_NetPerM->addItems(strList);
}
void NetPerson::GetNetPersonInfo()
{
bool res;
QString str,user,address,flag;
str=QString("select Net_Address,User,Flag from NetPerson where Id = '%1'").arg(NetPer_ID);
QSqlQuery query(*this->netPer_db->sqlite_db);
query.clear();
query.exec(str);
res=query.next();
if(res)
{
address=query.value(0).toString();
user=query.value(1).toString();
flag=query.value(2).toString();
int m=ui->comboBox_NetPerM->findText(address);
int n=ui->comboBox_NetPerM_Flag->findText(flag);
ui->comboBox_NetPerM->setCurrentIndex(m);
ui->lineEdit_NetPerM_User->setText(user);
ui->comboBox_NetPerM_Flag->setCurrentIndex(n);
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。