parent
c478e48755
commit
c41c516502
@ -0,0 +1,41 @@
|
||||
#include "checkbtn.h"
|
||||
#include "ui_checkbtn.h"
|
||||
#include "customerinfo.h"
|
||||
#include <QDebug>
|
||||
|
||||
checkbtn::checkbtn(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::checkbtn)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
}
|
||||
|
||||
checkbtn::~checkbtn()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void checkbtn::setroomNum(int roomNum){
|
||||
this->roomNum = roomNum;
|
||||
}
|
||||
|
||||
void checkbtn::setDB(QSqlDatabase db){
|
||||
this->db = db;
|
||||
}
|
||||
|
||||
void checkbtn::on_pushButton_clicked()
|
||||
{
|
||||
customerinfo *info = new customerinfo;
|
||||
info->setDB(db);
|
||||
info->setroomNum(roomNum);
|
||||
info->show();
|
||||
}
|
||||
|
||||
void checkbtn::setisused(bool i){
|
||||
isused = i;
|
||||
}
|
||||
|
||||
void checkbtn::setbtn(){
|
||||
ui->pushButton->setEnabled(!isused);
|
||||
qDebug()<<"ssss";
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
#ifndef CHECKBTN_H
|
||||
#define CHECKBTN_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <QSqlDatabase>
|
||||
|
||||
namespace Ui {
|
||||
class checkbtn;
|
||||
}
|
||||
|
||||
class checkbtn : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit checkbtn(QWidget *parent = nullptr);
|
||||
~checkbtn();
|
||||
void setroomNum(int roomNum);
|
||||
void setDB(QSqlDatabase db);
|
||||
void setisused(bool i);
|
||||
void setbtn();
|
||||
|
||||
private slots:
|
||||
void on_pushButton_clicked();
|
||||
|
||||
private:
|
||||
Ui::checkbtn *ui;
|
||||
int roomNum;
|
||||
QSqlDatabase db;
|
||||
bool isused;
|
||||
};
|
||||
|
||||
#endif // CHECKBTN_H
|
@ -0,0 +1,48 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>checkbtn</class>
|
||||
<widget class="QWidget" name="checkbtn">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QPushButton" name="pushButton">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>12</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>查看</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
@ -0,0 +1,22 @@
|
||||
#include "customerinfo.h"
|
||||
#include "ui_customerinfo.h"
|
||||
|
||||
customerinfo::customerinfo(QWidget *parent) :
|
||||
QMainWindow(parent),
|
||||
ui(new Ui::customerinfo)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
}
|
||||
|
||||
customerinfo::~customerinfo()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void customerinfo::setroomNum(int roomNum){
|
||||
this->roomNum = roomNum;
|
||||
}
|
||||
|
||||
void customerinfo::setDB(QSqlDatabase db){
|
||||
this->db = db;
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
#ifndef CUSTOMERINFO_H
|
||||
#define CUSTOMERINFO_H
|
||||
|
||||
#include <QMainWindow>
|
||||
#include <QSqlDatabase>
|
||||
#include <QSqlQuery>
|
||||
|
||||
namespace Ui {
|
||||
class customerinfo;
|
||||
}
|
||||
|
||||
class customerinfo : public QMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit customerinfo(QWidget *parent = nullptr);
|
||||
~customerinfo();
|
||||
void setDB(QSqlDatabase db);
|
||||
void setroomNum(int roomNum);
|
||||
|
||||
private:
|
||||
Ui::customerinfo *ui;
|
||||
QSqlDatabase db;
|
||||
int roomNum;
|
||||
};
|
||||
|
||||
#endif // CUSTOMERINFO_H
|
@ -0,0 +1,24 @@
|
||||
<ui version="4.0">
|
||||
<author/>
|
||||
<comment/>
|
||||
<exportmacro/>
|
||||
<class>customerinfo</class>
|
||||
<widget class="QMainWindow" name="customerinfo">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>600</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>MainWindow</string>
|
||||
</property>
|
||||
<widget class="QMenuBar" name="menubar"/>
|
||||
<widget class="QWidget" name="centralwidget"/>
|
||||
<widget class="QStatusBar" name="statusbar"/>
|
||||
</widget>
|
||||
<pixmapfunction/>
|
||||
<connections/>
|
||||
</ui>
|
Loading…
Reference in new issue