You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
1018 B
43 lines
1018 B
#include "add_administration.h"
|
|
#include "ui_add_administration.h"
|
|
#include "administration.h"
|
|
|
|
add_administration::add_administration(QWidget *parent) :
|
|
QDialog(parent),
|
|
ui(new Ui::add_administration)
|
|
{
|
|
ui->setupUi(this);
|
|
QIcon logo(":/image/icon/logo.png");
|
|
this->setWindowIcon(logo);
|
|
this->setWindowTitle("提示");
|
|
this->setFixedSize(400,300);
|
|
bg = new QLabel(this);
|
|
bg->setScaledContents(true);
|
|
bg->setPixmap(QPixmap(":/image/bg/add.jpg"));
|
|
bg->lower();
|
|
|
|
}
|
|
|
|
add_administration::~add_administration()
|
|
{
|
|
delete ui;
|
|
}
|
|
|
|
void add_administration::paintEvent(QPaintEvent*)
|
|
{
|
|
bg->resize(ui->widget->size());
|
|
}
|
|
|
|
void add_administration::on_pushButton_clicked()
|
|
{
|
|
//administration *ad = new administration;
|
|
QSqlQuery query((db));
|
|
query.prepare("INSERT into room VALUES(:n,1,1,1,1,NULL,NULL);");
|
|
query.bindValue(":n",ui->lineEdit->text());
|
|
query.exec();
|
|
QMessageBox::information(this,tr("提示"),("添加成功,请刷新"));
|
|
this->hide();
|
|
|
|
}
|
|
|