1 Star 0 Fork 4

boarmy/CaseBoxServer

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
boxform.cpp 1.86 KB
一键复制 编辑 原始数据 按行查看 历史
fuyaojiutian 提交于 2017-11-04 15:59 . PC端界面完成
#include "boxform.h"
#include "ui_boxform.h"
BoxForm::BoxForm(datebase *db,int ID,QWidget *parent) :
QDialog(parent),
ui(new Ui::BoxForm)
{
ui->setupUi(this);
setWindowFlags(Qt::FramelessWindowHint);
box_db=db;
box_ID=ID;
getNet();
GetBoxInfo();
}
BoxForm::~BoxForm()
{
delete ui;
}
void BoxForm::GetBoxInfo()
{
bool res;
QString str,pass,name,address;
str=QString("select Pass_No,Card_Sn,Net_Address from FeeBox where Id = %1").arg(box_ID);
QSqlQuery query(*this->box_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();
int m=ui->comboBox_BoxM_Net->findText(address);
ui->lineEdit_BoxM_Ic->setText(pass);
ui->lineEdit_BoxM_Id->setText(name);
ui->comboBox_BoxM_Net->setCurrentIndex(m);
}
}
void BoxForm::on_pushButton_OK_clicked()
{
QString pass,card,address;
pass=ui->lineEdit_BoxM_Id->text().trimmed();
card=ui->lineEdit_BoxM_Ic->text().trimmed();
address=ui->comboBox_BoxM_Net->currentText().trimmed();
box_db->updateBoxInfo(box_db->sqlite_db,box_ID,pass,card,address);
this->close();
}
void BoxForm::on_pushButton_Quit_clicked()
{
this->close();
}
void BoxForm::paintEvent(QPaintEvent *)//
{
QPixmap pix(":/images/Sback.jpg");
QPainter painter(this);
int w = width();
int h = height();
painter.drawPixmap(0,0,w,h,pix);
}
void BoxForm::getNet()
{
QSqlQuery query(*this->box_db->sqlite_db);
QString name;
QStringList strList;
ui->comboBox_BoxM_Net->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_BoxM_Net->addItems(strList);
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/boarmy/CaseBoxServer.git
git@gitee.com:boarmy/CaseBoxServer.git
boarmy
CaseBoxServer
CaseBoxServer
master

搜索帮助