#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);}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。