├── journey.cpp ├── logo.rc ├── .vs ├── ProjectSettings.json ├── slnx.sqlite ├── TrainTicketManage │ └── v16 │ │ ├── .suo │ │ └── Browse.VC.db └── VSWorkspaceState.json ├── .gitattributes ├── logo1.ico ├── passengerbuy.cpp ├── passengerrefund.cpp ├── passengerendorse.cpp ├── dialog.h ├── passengerbuy.h ├── passengerrefund.h ├── passengerendorse.h ├── dialog.cpp ├── login.ui ├── passenger.h ├── passengerbuy.ui ├── passengerendorse.ui ├── passengerrefund.ui ├── confirmrefund.h ├── confirmrefund.cpp ├── form.h ├── connection.h ├── main.cpp ├── journey.h ├── mainwindow.ui ├── mainwindow.h ├── journey.sql ├── TrainTicketManage.pro ├── README.md ├── mainwindow.cpp ├── subwindow.h ├── triwindow.h ├── form.cpp ├── dialog.ui ├── form.ui ├── confirmrefund.ui ├── subwindow.cpp ├── triwindow.cpp ├── subwindow.ui ├── triwindow.ui └── TrainTicketManage.pro.user /journey.cpp: -------------------------------------------------------------------------------- 1 | #include "journey.h" 2 | -------------------------------------------------------------------------------- /logo.rc: -------------------------------------------------------------------------------- 1 | IDI_ICON1 ICON DISCARDABLE "logo1.ico" -------------------------------------------------------------------------------- /.vs/ProjectSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "CurrentProjectSetting": "无配置" 3 | } -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /logo1.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lxysl/train_ticket_manage_QtApplication/HEAD/logo1.ico -------------------------------------------------------------------------------- /.vs/slnx.sqlite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lxysl/train_ticket_manage_QtApplication/HEAD/.vs/slnx.sqlite -------------------------------------------------------------------------------- /.vs/TrainTicketManage/v16/.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lxysl/train_ticket_manage_QtApplication/HEAD/.vs/TrainTicketManage/v16/.suo -------------------------------------------------------------------------------- /.vs/TrainTicketManage/v16/Browse.VC.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lxysl/train_ticket_manage_QtApplication/HEAD/.vs/TrainTicketManage/v16/Browse.VC.db -------------------------------------------------------------------------------- /.vs/VSWorkspaceState.json: -------------------------------------------------------------------------------- 1 | { 2 | "ExpandedNodes": [ 3 | "" 4 | ], 5 | "SelectedNode": "\\journey.sql", 6 | "PreviewInSolutionExplorer": false 7 | } -------------------------------------------------------------------------------- /passengerbuy.cpp: -------------------------------------------------------------------------------- 1 | #include "passengerbuy.h" 2 | #include "ui_passengerbuy.h" 3 | 4 | passengerbuy::passengerbuy(QWidget *parent) : 5 | QWidget(parent), 6 | ui(new Ui::passengerbuy) 7 | { 8 | ui->setupUi(this); 9 | } 10 | 11 | passengerbuy::~passengerbuy() 12 | { 13 | delete ui; 14 | } 15 | -------------------------------------------------------------------------------- /passengerrefund.cpp: -------------------------------------------------------------------------------- 1 | #include "passengerrefund.h" 2 | #include "ui_passengerrefund.h" 3 | 4 | passengerrefund::passengerrefund(QWidget *parent) : 5 | QWidget(parent), 6 | ui(new Ui::passengerrefund) 7 | { 8 | ui->setupUi(this); 9 | } 10 | 11 | passengerrefund::~passengerrefund() 12 | { 13 | delete ui; 14 | } 15 | -------------------------------------------------------------------------------- /passengerendorse.cpp: -------------------------------------------------------------------------------- 1 | #include "passengerendorse.h" 2 | #include "ui_passengerendorse.h" 3 | 4 | passengerendorse::passengerendorse(QWidget *parent) : 5 | QWidget(parent), 6 | ui(new Ui::passengerendorse) 7 | { 8 | ui->setupUi(this); 9 | } 10 | 11 | passengerendorse::~passengerendorse() 12 | { 13 | delete ui; 14 | } 15 | -------------------------------------------------------------------------------- /dialog.h: -------------------------------------------------------------------------------- 1 | #ifndef DIALOG_H 2 | #define DIALOG_H 3 | 4 | #include 5 | 6 | namespace Ui { 7 | class Dialog; 8 | } 9 | 10 | class Dialog : public QDialog 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | explicit Dialog(QWidget *parent = 0); 16 | ~Dialog(); 17 | void initDialog(); 18 | 19 | private: 20 | Ui::Dialog *ui; 21 | }; 22 | 23 | #endif // DIALOG_H 24 | -------------------------------------------------------------------------------- /passengerbuy.h: -------------------------------------------------------------------------------- 1 | #ifndef PASSENGERBUY_H 2 | #define PASSENGERBUY_H 3 | 4 | #include 5 | 6 | namespace Ui { 7 | class passengerbuy; 8 | } 9 | 10 | class passengerbuy : public QWidget 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | explicit passengerbuy(QWidget *parent = 0); 16 | ~passengerbuy(); 17 | 18 | private: 19 | Ui::passengerbuy *ui; 20 | }; 21 | 22 | #endif // PASSENGERBUY_H 23 | -------------------------------------------------------------------------------- /passengerrefund.h: -------------------------------------------------------------------------------- 1 | #ifndef PASSENGERREFUND_H 2 | #define PASSENGERREFUND_H 3 | 4 | #include 5 | 6 | namespace Ui { 7 | class passengerrefund; 8 | } 9 | 10 | class passengerrefund : public QWidget 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | explicit passengerrefund(QWidget *parent = 0); 16 | ~passengerrefund(); 17 | 18 | private: 19 | Ui::passengerrefund *ui; 20 | }; 21 | 22 | #endif // PASSENGERREFUND_H 23 | -------------------------------------------------------------------------------- /passengerendorse.h: -------------------------------------------------------------------------------- 1 | #ifndef PASSENGERENDORSE_H 2 | #define PASSENGERENDORSE_H 3 | 4 | #include 5 | 6 | namespace Ui { 7 | class passengerendorse; 8 | } 9 | 10 | class passengerendorse : public QWidget 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | explicit passengerendorse(QWidget *parent = 0); 16 | ~passengerendorse(); 17 | 18 | private: 19 | Ui::passengerendorse *ui; 20 | }; 21 | 22 | #endif // PASSENGERENDORSE_H 23 | -------------------------------------------------------------------------------- /dialog.cpp: -------------------------------------------------------------------------------- 1 | #include "dialog.h" 2 | #include "ui_dialog.h" 3 | #include 4 | #include 5 | 6 | Dialog::Dialog(QWidget *parent) : 7 | QDialog(parent), 8 | ui(new Ui::Dialog) 9 | { 10 | ui->setupUi(this); 11 | } 12 | 13 | Dialog::~Dialog() 14 | { 15 | delete ui; 16 | } 17 | 18 | void Dialog::initDialog(){ 19 | this->vpassengerList=&(MainWindow.passengerList); 20 | this->vip=&(MainWindow.ip); 21 | } 22 | -------------------------------------------------------------------------------- /login.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | loginDialog 4 | 5 | 6 | 7 | 0 8 | 0 9 | 400 10 | 300 11 | 12 | 13 | 14 | Dialog 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /passenger.h: -------------------------------------------------------------------------------- 1 | #ifndef PASSENGER_H 2 | #define PASSENGER_H 3 | #include 4 | 5 | class passenger{ 6 | private: 7 | QString name; 8 | QString id; 9 | public: 10 | passenger(){} 11 | passenger(QString name,QString id){ 12 | this->name=name; 13 | this->id=id; 14 | } 15 | QString getName() const{ 16 | return this->name; 17 | } 18 | QString getId() const{ 19 | return this->id; 20 | } 21 | }; 22 | 23 | #endif // PASSENGER_H 24 | -------------------------------------------------------------------------------- /passengerbuy.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | passengerbuy 6 | 7 | 8 | 9 | 0 10 | 0 11 | 400 12 | 300 13 | 14 | 15 | 16 | Form 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /passengerendorse.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | passengerendorse 6 | 7 | 8 | 9 | 0 10 | 0 11 | 400 12 | 300 13 | 14 | 15 | 16 | Form 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /passengerrefund.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | passengerrefund 6 | 7 | 8 | 9 | 0 10 | 0 11 | 400 12 | 300 13 | 14 | 15 | 16 | Form 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /confirmrefund.h: -------------------------------------------------------------------------------- 1 | #ifndef CONFIRMREFUND_H 2 | #define CONFIRMREFUND_H 3 | 4 | #include 5 | #include 6 | 7 | namespace Ui { 8 | class confirmRefund; 9 | } 10 | 11 | class confirmRefund : public QWidget 12 | { 13 | Q_OBJECT 14 | 15 | public: 16 | explicit confirmRefund(QWidget *parent = 0); 17 | ~confirmRefund(); 18 | void sendConfirmSignal(); 19 | void sendNConfirmSignal(); 20 | signals: 21 | void confirm(); 22 | void nconfirm(); 23 | 24 | private: 25 | Ui::confirmRefund *ui; 26 | }; 27 | 28 | #endif // CONFIRMREFUND_H 29 | -------------------------------------------------------------------------------- /confirmrefund.cpp: -------------------------------------------------------------------------------- 1 | #include "confirmrefund.h" 2 | #include "ui_confirmrefund.h" 3 | 4 | confirmRefund::confirmRefund(QWidget *parent) : 5 | QWidget(parent), 6 | ui(new Ui::confirmRefund) 7 | { 8 | ui->setupUi(this); 9 | setWindowTitle("确认退票"); 10 | connect(ui->yesPushButton,QPushButton::clicked,this,this->sendConfirmSignal); 11 | connect(ui->noPushButton,QPushButton::clicked,this,this->sendNConfirmSignal); 12 | } 13 | 14 | confirmRefund::~confirmRefund() 15 | { 16 | delete ui; 17 | } 18 | 19 | void confirmRefund::sendConfirmSignal() 20 | { 21 | emit confirm(); 22 | } 23 | 24 | void confirmRefund::sendNConfirmSignal() 25 | { 26 | emit nconfirm(); 27 | } 28 | -------------------------------------------------------------------------------- /form.h: -------------------------------------------------------------------------------- 1 | #ifndef FORM_H 2 | #define FORM_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include "subwindow.h" 8 | #include "triwindow.h" 9 | 10 | namespace Ui { 11 | class Form; 12 | } 13 | 14 | class Form : public QWidget 15 | { 16 | Q_OBJECT 17 | 18 | public: 19 | explicit Form(subwindow *s,triwindow *t,QWidget *parent = 0); 20 | ~Form(); 21 | void showMySelf(); 22 | private slots: 23 | 24 | void on_passengerButtonBox_accepted(); 25 | 26 | void on_passengerButtonBox_rejected(); 27 | 28 | void on_managerButtonBox_accepted(); 29 | 30 | void on_managerButtonBox_rejected(); 31 | 32 | private: 33 | Ui::Form *ui; 34 | subwindow *vsubwindow; 35 | triwindow *vtriwindow; 36 | }; 37 | 38 | #endif // FORM_H 39 | -------------------------------------------------------------------------------- /connection.h: -------------------------------------------------------------------------------- 1 | #ifndef CONNECTION_H 2 | #define CONNECTION_H 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | static bool createConnection(){ 9 | QSqlDatabase database=QSqlDatabase::addDatabase("QMYSQL"); 10 | database.setHostName("localhost"); 11 | database.setDatabaseName("mysql"); 12 | database.setUserName("root"); 13 | database.setPassword("lxyL764139720"); 14 | if(!database.open()){ 15 | QMessageBox::warning(0,"错误",database.lastError().text()); 16 | return false; 17 | }else{ 18 | QMessageBox::information(0,"数据库","成功"); 19 | }// 如果 MySQL 数据库中已经存在同名的表, 那么下面的代码不会执行 20 | QSqlQuery trainData(database);// 使数据库支持中文 21 | trainData.exec("SET NAMES'Latin1'"); 22 | return true; 23 | } 24 | 25 | #endif // CONNECTION_H 26 | -------------------------------------------------------------------------------- /main.cpp: -------------------------------------------------------------------------------- 1 | #include "form.h" 2 | #include "subwindow.h" 3 | #include "triwindow.h" 4 | #include "journey.h" 5 | #include "passenger.h" 6 | #include 7 | #include 8 | 9 | 10 | int main(int argc, char *argv[]) 11 | { 12 | QApplication a(argc, argv); 13 | QProcess process; 14 | process.start("D:\mysql-5.7.26-win32\mysql-5.7.26-win32\bin\mysqld.exe"); 15 | QSqlDatabase trainDataBase=QSqlDatabase::addDatabase("QMYSQL"); 16 | trainDataBase.setHostName("localhost"); 17 | trainDataBase.setDatabaseName("mysql"); 18 | trainDataBase.setUserName("root"); 19 | trainDataBase.setPassword(""); 20 | if(!trainDataBase.open()){ 21 | QMessageBox::warning(0,"错误",trainDataBase.lastError().text()); 22 | return false; 23 | } 24 | subwindow s; 25 | triwindow t; 26 | Form f(&s,&t); 27 | f.show(); 28 | return a.exec(); 29 | } 30 | -------------------------------------------------------------------------------- /journey.h: -------------------------------------------------------------------------------- 1 | #ifndef JOURNEY_H 2 | #define JOURNEY_H 3 | #include 4 | 5 | class journey{ 6 | public: 7 | QString id; 8 | QString name; 9 | QString startPro; 10 | QString startCity; 11 | QString endPro; 12 | QString endCity; 13 | QString seat; 14 | QString startTime; 15 | int price; 16 | QString purchaseTime; 17 | public: 18 | journey() {} 19 | journey(QString id,QString name,QString startPro,QString startCity,QString endPro,QString endCity,QString seat,QString startTime,int price,QString purchaseTime){ 20 | this->id=id; 21 | this->name=name; 22 | this->startPro=startPro; 23 | this->startCity=startCity; 24 | this->endPro=endPro; 25 | this->endCity=endCity; 26 | this->seat=seat; 27 | this->startTime=startTime; 28 | this->price=price; 29 | this->purchaseTime=purchaseTime; 30 | } 31 | }; 32 | 33 | 34 | 35 | #endif // JOURNEY_H 36 | -------------------------------------------------------------------------------- /mainwindow.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | MainWindow 4 | 5 | 6 | 7 | 0 8 | 0 9 | 774 10 | 607 11 | 12 | 13 | 14 | MainWindow 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 0 23 | 0 24 | 774 25 | 25 26 | 27 | 28 | 29 | 30 | 31 | TopToolBarArea 32 | 33 | 34 | false 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /mainwindow.h: -------------------------------------------------------------------------------- 1 | #ifndef MAINWINDOW_H 2 | #define MAINWINDOW_H 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include "journey.h" 15 | #include "passenger.h" 16 | 17 | 18 | namespace Ui { 19 | class MainWindow; 20 | } 21 | 22 | class QSqlTableModel;//数据库图表类前置类型声明 23 | 24 | class MainWindow : public QMainWindow 25 | { 26 | Q_OBJECT 27 | 28 | public: 29 | 30 | explicit MainWindow(QWidget *parent = 0); 31 | ~MainWindow(); 32 | //QString getInitManagerAccount()const; 33 | //QString getInitManagerPassword()const; 34 | //passenger& getNowPassenger(); 35 | //journey& getAJourney(); 36 | //void changeManagerAccount(); 37 | //void changeManagerPassword(); 38 | //bool createConnection(); 39 | private slots: 40 | 41 | private: 42 | //QString initManagerAccount;//tri 43 | //QString initManagerPassword;//tri 44 | Ui::MainWindow *ui; 45 | //passenger nowPassenger;//subwindow 46 | //journey aJourney; 47 | //QSqlDatabase trainDataBase;//form 48 | }; 49 | 50 | #endif // MAINWINDOW_H 51 | -------------------------------------------------------------------------------- /journey.sql: -------------------------------------------------------------------------------- 1 | /* 2 | Navicat Premium Data Transfer 3 | 4 | Source Server : localhost 5 | Source Server Type : MySQL 6 | Source Server Version : 80016 7 | Source Host : localhost:3306 8 | Source Schema : journey 9 | 10 | Target Server Type : MySQL 11 | Target Server Version : 80016 12 | File Encoding : 65001 13 | 14 | Date: 04/07/2019 16:37:16 15 | */ 16 | 17 | SET NAMES utf8mb4; 18 | SET FOREIGN_KEY_CHECKS = 0; 19 | 20 | -- ---------------------------- 21 | -- Table structure for journey 22 | -- ---------------------------- 23 | DROP TABLE IF EXISTS `journey`; 24 | CREATE TABLE `journey` ( 25 | `身份证号` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL, 26 | `姓名` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL, 27 | `始发站` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL, 28 | `终点站` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL, 29 | `发车时间` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL, 30 | `席别` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL, 31 | `购票时间` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL 32 | ) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_unicode_ci ROW_FORMAT = Dynamic; 33 | 34 | SET FOREIGN_KEY_CHECKS = 1; 35 | -------------------------------------------------------------------------------- /TrainTicketManage.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2019-07-02T15:49:43 4 | # 5 | #------------------------------------------------- 6 | 7 | QT += core gui sql 8 | RC_FILE = logo.rc 9 | 10 | 11 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 12 | 13 | TARGET = TrainTicketManage 14 | TEMPLATE = app 15 | 16 | # The following define makes your compiler emit warnings if you use 17 | # any feature of Qt which as been marked as deprecated (the exact warnings 18 | # depend on your compiler). Please consult the documentation of the 19 | # deprecated API in order to know how to port your code away from it. 20 | DEFINES += QT_DEPRECATED_WARNINGS 21 | 22 | # You can also make your code fail to compile if you use deprecated APIs. 23 | # In order to do so, uncomment the following line. 24 | # You can also select to disable deprecated APIs only up to a certain version of Qt. 25 | #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 26 | 27 | 28 | SOURCES += \ 29 | main.cpp \ 30 | form.cpp \ 31 | subwindow.cpp \ 32 | triwindow.cpp \ 33 | confirmrefund.cpp 34 | 35 | HEADERS += \ 36 | form.h \ 37 | subwindow.h \ 38 | triwindow.h \ 39 | confirmrefund.h \ 40 | journey.h \ 41 | passenger.h 42 | 43 | FORMS += \ 44 | form.ui \ 45 | subwindow.ui \ 46 | triwindow.ui \ 47 | confirmrefund.ui 48 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [TOC] 2 | > 由于使用了本地MySQL数据库的原因,~~所以本程序可能不能在本机之外的机器上运行~~,故文件夹中附有程序源码 3 | > 4 | > 解决方法:在电脑上安装32位的MySQL数据库,并把源码中main.cpp中的路径修改为本地\bin\mysqld.exe所在的路径 5 | 6 | --- 7 | 8 | ## 程序使用方法 9 | ~~如果你能打开的话~~ 10 | 11 | #### 登录窗口 12 | 13 | * 这里你可以选择乘客登录或者管理员登录 14 | * **乘客登录窗口** 你需要输入乘客的姓名和身份证号(姓名可以是文字或数字,身份证号则必须是数字)。如果你曾经登录过,那么你输入的身份证号和姓名必须和第一次登录时一致。如果你第一次登录,则根据你的身份证号和姓名创建新的用户,但如果你未执行购票操作的话则不会在数据库中记录你的名字和身份证号。 15 | 点击取消退出程序。 16 | * **管理员登录窗口** 你需要输入获知的管理员账号和密码。 17 | 点击取消退出程序。 18 | 19 | #### 乘客端 20 | 21 | * 左侧顶部显示了你的姓名和身份证号,左侧中部是你可以执行的操作按钮,左侧下方默认显示购票界面,右侧是你的购票数据。点击购票按钮、退票按钮或改签按钮,左侧下方的界面会随即变更。点击退出按钮,回到登录窗口。 22 | * **购票界面** 你需要在下拉框中选择始发站和终点站,城市会随着省份的变化而变化,目前只有河北省和北京市的若干城市可供选择(默认的北京市在城市一栏不会显示北京,你需要先在省份一栏中选择河北省,再选回北京市,这时城市一栏中才会显示出北京)。 23 | 之后你还需要选择席别,有硬座、卧铺、站票和高铁可选,程序会根据席别自动确定单张票价,依次是150、300、50和500元。 24 | 然后选择购票张数,你只被允许在1至5内进行选择。 25 | 最后在日历中选择您的乘车日期,注意只能选择今天或今天之后的日期。 26 | 全部选择好后你可以点击显示价格来查看价格,价格是根据席别和购票张数的乘积进行计算的,与站点无关 27 | 确认无误后点击购票购买,即可在右侧的表格中查看购票记录 28 | 购票时间是你购票的日期,由系统自动获取 29 | * **退票界面** 首先会弹出一个对话框进行引导操作。在输入框内输入购票记录的序号,再点击退票。这时会弹出一个对话框确认删除,注意退票不可恢复。 30 | * **改签界面** 首先会弹出一个对话框进行引导操作。先在右侧表格中选择你要改签车票的始发时间单元格,再在左边日历中选择你想改签的日期,点击提交即可。注意改签日期必须是今天或今天之后的日期。 31 | 32 | #### 管理员端 33 | 34 | * 左侧顶部是你可以执行的操作按钮,左侧下方默认显示添加界面,右侧是所有的购票数据。点击添加、删除、查询或统计按钮,左侧下方的界面会随即变更。点击恢复、保存或修改按钮,会弹出对话框指引操作或进行提示。点击返回按钮,回到登录窗口。 35 | * **添加界面** 和乘客端操作基本一致,在此基础上你需要输入乘客的姓名和身份证号,还删去了显示价格的按钮。 36 | * **删除界面** 和乘客端操作基本一致,但是删除后只要没有保存都可以恢复。如果需要真的在数据库里删除,需要点击保存按钮。 37 | * **恢复按钮** 点击即可恢复删除的数据。 38 | * **查询按钮** 在下拉框中你可以选择按身份证号查找或按姓名查找。然后在输入框中输入身份证号或姓名,点击查询即在右面的表格中显示查询结果。如果没有对应的数据,则会弹出对话框进行提示。点击显示全部即可查看所有数据。 39 | * **修改按钮** 在右侧表格中进行修改,再点击保存。 40 | * **保存按钮** 点击即可在数据库中保存数据。 41 | * **统计按钮** 在日历中选择日期,再点击统计。前两行显示的是你选择的那天的购票数量和总价格。在统计单价的下拉框中你可以选择要进行统计的票价区间。点击统计后,就会显示你选择的票价区间的购票张数和总价格。 42 | -------------------------------------------------------------------------------- /mainwindow.cpp: -------------------------------------------------------------------------------- 1 | #include "mainwindow.h" 2 | #include "ui_mainwindow.h" 3 | #include 4 | #include 5 | 6 | MainWindow::MainWindow(QWidget *parent) : 7 | QMainWindow(parent), 8 | ui(new Ui::MainWindow) 9 | { 10 | ui->setupUi(this); 11 | // this->initManagerAccount="123456"; 12 | // this->initManagerPassword="000000"; 13 | } 14 | 15 | MainWindow::~MainWindow() 16 | { 17 | delete ui; 18 | } 19 | 20 | //QString MainWindow::getInitManagerAccount()const 21 | //{ 22 | // return this->initManagerAccount; 23 | //} 24 | 25 | //QString MainWindow::getInitManagerPassword()const 26 | //{ 27 | // return this->initManagerPassword; 28 | //} 29 | 30 | //passenger &MainWindow::getNowPassenger() 31 | //{ 32 | // return this->nowPassenger; 33 | //} 34 | 35 | //journey &MainWindow::getAJourney() 36 | //{ 37 | // return this->aJourney; 38 | //} 39 | 40 | //void MainWindow::changeManagerAccount() 41 | //{ 42 | 43 | //} 44 | 45 | //void MainWindow::changeManagerPassword() 46 | //{ 47 | 48 | //} 49 | 50 | //bool MainWindow::createConnection() 51 | //{ 52 | // this->trainDataBase=QSqlDatabase::addDatabase("QMYSQL"); 53 | // this->trainDataBase.setHostName("localhost"); 54 | // this->trainDataBase.setDatabaseName("mysql"); 55 | // this->trainDataBase.setUserName("root"); 56 | // this->trainDataBase.setPassword(""); 57 | // if(!this->trainDataBase.open()){ 58 | // QMessageBox::warning(0,"错误",this->trainDataBase.lastError().text()); 59 | // return false; 60 | // } 61 | // QSqlQuery Data(this->trainDataBase); 62 | //} 63 | 64 | //QString passenger::getName()const 65 | //{ 66 | // return this->name; 67 | //} 68 | 69 | //QString passenger::getId()const 70 | //{ 71 | // return this->id; 72 | //} 73 | -------------------------------------------------------------------------------- /subwindow.h: -------------------------------------------------------------------------------- 1 | #ifndef SUBWINDOW_H 2 | #define SUBWINDOW_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include "triwindow.h" 14 | #include "confirmrefund.h" 15 | #include "journey.h" 16 | #include "passenger.h" 17 | 18 | namespace Ui { 19 | class subwindow; 20 | } 21 | 22 | class QSqlTableModel;//数据库图表类前置类型声明 23 | 24 | class subwindow : public QWidget 25 | { 26 | Q_OBJECT 27 | 28 | public: 29 | explicit subwindow(QWidget *parent = 0); 30 | ~subwindow(); 31 | void sendShowSignal(); 32 | void setPassengerText(); 33 | void confirmDelete(); 34 | void nConfirmDelete(); 35 | QSqlTableModel *getModel(); 36 | passenger& getNowPassenger(); 37 | signals: 38 | void showForm(); 39 | private slots: 40 | void on_buy_clicked(bool checked); 41 | 42 | void on_refund_clicked(bool checked); 43 | 44 | void on_endorse_clicked(bool checked); 45 | 46 | void on_startProvince_currentTextChanged(const QString &arg1); 47 | 48 | void on_endProvince_currentTextChanged(const QString &arg1); 49 | 50 | void on_purchaseButton_clicked(bool checked); 51 | 52 | void on_priceShowButton_clicked(bool checked); 53 | 54 | void on_refundButton_clicked(bool checked); 55 | 56 | void on_submitPushButton_clicked(); 57 | 58 | void on_CancelPushButton_clicked(); 59 | 60 | void on_tableView_clicked(const QModelIndex &index); 61 | 62 | private: 63 | Ui::subwindow *ui; 64 | passenger nowPassenger; 65 | QSqlTableModel *model;//一个数据库表可视化模型 66 | confirmRefund *confirm; 67 | QModelIndex index; 68 | }; 69 | 70 | #endif // SUBWINDOW_H 71 | -------------------------------------------------------------------------------- /triwindow.h: -------------------------------------------------------------------------------- 1 | #ifndef TRIWINDOW_H 2 | #define TRIWINDOW_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | 17 | namespace Ui { 18 | class triwindow; 19 | } 20 | 21 | class triwindow : public QWidget 22 | { 23 | Q_OBJECT 24 | 25 | public: 26 | explicit triwindow(QWidget *parent = 0); 27 | ~triwindow(); 28 | void sendShowSignal(); 29 | QString getInitManagerAccount()const; 30 | QString getInitManagerPassword()const; 31 | signals: 32 | void showForm(); 33 | 34 | private slots: 35 | void on_addPushButton_clicked(); 36 | 37 | void on_deletePushButton_clicked(); 38 | 39 | void on_searchPushButton_clicked(); 40 | 41 | void on_modifyPushButton_clicked(); 42 | 43 | void on_statisticPushButton_clicked(); 44 | 45 | void on_startProvince_currentTextChanged(const QString &arg1); 46 | 47 | void on_endProvince_currentTextChanged(const QString &arg1); 48 | 49 | void on_addPushButton_2_clicked(); 50 | 51 | void on_deletePushButton_2_clicked(); 52 | 53 | void on_recoverPushButton_clicked(); 54 | 55 | void on_savePushButton_clicked(); 56 | 57 | void on_mannerComboBox_currentTextChanged(const QString &arg1); 58 | 59 | void on_searchPushButton_2_clicked(); 60 | 61 | void on_showAll_clicked(); 62 | 63 | void on_statisticPushButton_2_clicked(); 64 | 65 | private: 66 | Ui::triwindow *ui; 67 | QSqlTableModel *model; 68 | QModelIndex index; 69 | QList deletList; 70 | QString initManagerAccount;//tri 71 | QString initManagerPassword;//tri 72 | }; 73 | 74 | #endif // TRIWINDOW_H 75 | -------------------------------------------------------------------------------- /form.cpp: -------------------------------------------------------------------------------- 1 | #include "form.h" 2 | #include "ui_form.h" 3 | 4 | Form::Form(subwindow *s,triwindow *t,QWidget *parent) : 5 | QWidget(parent), 6 | ui(new Ui::Form) 7 | { 8 | ui->setupUi(this); 9 | setWindowTitle("登录"); 10 | this->vsubwindow=s; 11 | this->vtriwindow=t; 12 | connect(this->vsubwindow,this->vsubwindow->showForm,this,this->showMySelf); 13 | connect(this->vtriwindow,this->vtriwindow->showForm,this,this->showMySelf); 14 | } 15 | 16 | Form::~Form() 17 | { 18 | delete ui; 19 | } 20 | 21 | void Form::showMySelf() 22 | { 23 | this->vsubwindow->close(); 24 | this->vtriwindow->close(); 25 | this->show(); 26 | } 27 | 28 | void Form::on_passengerButtonBox_accepted() 29 | { 30 | QString passengerName=ui->passengerName->text(); 31 | QString passengerAccount=ui->passengerAccount->text(); 32 | bool ok; 33 | int isText=passengerAccount.toInt(&ok,10); 34 | passenger aPassenger(passengerName,passengerAccount); 35 | if(passengerName==""||passengerAccount==""){//用户无输入 36 | QMessageBox::warning(this,"警告","请输入姓名和身份证号",QMessageBox::Ok); 37 | } 38 | else if(!ok){ 39 | QMessageBox::warning(this,"警告","身份证号必须是数字",QMessageBox::Ok); 40 | }else{ 41 | this->vsubwindow->getModel()->setFilter(QObject::tr("id='%1'").arg(passengerAccount)); 42 | this->vsubwindow->getModel()->select();//只看自己 43 | if(this->vsubwindow->getModel()->rowCount()!=0){ 44 | QString name = this->vsubwindow->getModel()->record(0).value("name").toString(); 45 | if(name!=passengerName){ 46 | QMessageBox::warning(this,"用户登录","姓名错误",QMessageBox::Cancel); 47 | }else{ 48 | this->vsubwindow->getNowPassenger()=aPassenger;//设置当前乘客 49 | this->vsubwindow->setPassengerText(); 50 | QMessageBox::information(this,"用户登录","登录成功",QMessageBox::Ok); 51 | this->hide(); 52 | vsubwindow->show(); 53 | } 54 | }else{ 55 | this->vsubwindow->getNowPassenger()=aPassenger;//设置当前乘客 56 | this->vsubwindow->setPassengerText(); 57 | QMessageBox::information(this,"用户登录","新用户登录成功",QMessageBox::Ok); 58 | this->hide(); 59 | vsubwindow->show(); 60 | } 61 | } 62 | } 63 | 64 | void Form::on_passengerButtonBox_rejected() 65 | { 66 | this->close(); 67 | } 68 | 69 | void Form::on_managerButtonBox_accepted() 70 | { 71 | QString managerAccount=ui->managerAccount->text(); 72 | QString managerPassword=ui->managerPassword->text(); 73 | if(managerAccount==vtriwindow->getInitManagerAccount()&&managerPassword==vtriwindow->getInitManagerPassword()){ 74 | QMessageBox::information(this,"管理员登录","登录成功",QMessageBox::Ok); 75 | this->hide(); 76 | vtriwindow->show(); 77 | }else{ 78 | QMessageBox::warning(this,"警告","账号或密码错误",QMessageBox::Ok); 79 | } 80 | } 81 | 82 | void Form::on_managerButtonBox_rejected() 83 | { 84 | this->close(); 85 | } 86 | -------------------------------------------------------------------------------- /dialog.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | loginDialog 4 | 5 | 6 | 7 | 0 8 | 0 9 | 400 10 | 300 11 | 12 | 13 | 14 | Dialog 15 | 16 | 17 | 18 | 19 | 0 20 | 0 21 | 401 22 | 301 23 | 24 | 25 | 26 | Qt::ActionsContextMenu 27 | 28 | 29 | 0 30 | 31 | 32 | 33 | 乘客 34 | 35 | 36 | 37 | 38 | 39 | 账号 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 密码 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | Qt::Horizontal 60 | 61 | 62 | QDialogButtonBox::Cancel|QDialogButtonBox::Ok 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 管理员 71 | 72 | 73 | 74 | 75 | 76 | 账号 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 密码 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | QDialogButtonBox::Cancel|QDialogButtonBox::Ok 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | -------------------------------------------------------------------------------- /form.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Form 4 | 5 | 6 | 7 | 0 8 | 0 9 | 500 10 | 371 11 | 12 | 13 | 14 | Form 15 | 16 | 17 | 18 | 19 | 20 | 0 21 | 22 | 23 | 24 | 乘客 25 | 26 | 27 | 28 | 29 | 30 | 姓名 31 | 32 | 33 | 34 | 35 | 36 | 37 | QLineEdit::Normal 38 | 39 | 40 | 41 | 42 | 43 | 44 | 身份证号 45 | 46 | 47 | 48 | 49 | 50 | 51 | QLineEdit::Password 52 | 53 | 54 | 55 | 56 | 57 | 58 | QDialogButtonBox::Cancel|QDialogButtonBox::Ok 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 管理员 67 | 68 | 69 | 70 | 71 | 72 | 账号 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 密码 83 | 84 | 85 | 86 | 87 | 88 | 89 | QLineEdit::Password 90 | 91 | 92 | 93 | 94 | 95 | 96 | QDialogButtonBox::Cancel|QDialogButtonBox::Ok 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | -------------------------------------------------------------------------------- /confirmrefund.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | confirmRefund 4 | 5 | 6 | 7 | 0 8 | 0 9 | 400 10 | 300 11 | 12 | 13 | 14 | Form 15 | 16 | 17 | 18 | 19 | 20 | Qt::Vertical 21 | 22 | 23 | 24 | 20 25 | 65 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | Qt::Horizontal 34 | 35 | 36 | 37 | 60 38 | 20 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 确认删除? 47 | 48 | 49 | Qt::AlignCenter 50 | 51 | 52 | 53 | 54 | 55 | 56 | Qt::Horizontal 57 | 58 | 59 | 60 | 60 61 | 20 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | Qt::Vertical 70 | 71 | 72 | 73 | 20 74 | 64 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | Qt::Vertical 83 | 84 | 85 | 86 | 20 87 | 64 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | Qt::Horizontal 96 | 97 | 98 | 99 | 60 100 | 20 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 确认 109 | 110 | 111 | 112 | 113 | 114 | 115 | Qt::Horizontal 116 | 117 | 118 | 119 | 61 120 | 20 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 取消 129 | 130 | 131 | 132 | 133 | 134 | 135 | Qt::Horizontal 136 | 137 | 138 | 139 | 60 140 | 20 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | Qt::Vertical 149 | 150 | 151 | 152 | 20 153 | 65 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | Qt::Vertical 162 | 163 | 164 | 165 | 20 166 | 65 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | -------------------------------------------------------------------------------- /subwindow.cpp: -------------------------------------------------------------------------------- 1 | #include "subwindow.h" 2 | #include "ui_subwindow.h" 3 | 4 | subwindow::subwindow(QWidget *parent) : 5 | QWidget(parent), 6 | ui(new Ui::subwindow) 7 | { 8 | ui->setupUi(this); 9 | setWindowTitle("乘客端"); 10 | this->confirm=new confirmRefund(); 11 | ui->numberSpinBox->setMinimum(1); 12 | ui->numberSpinBox->setMaximum(5); 13 | this->model = new QSqlTableModel(this);//一个数据库表可视化模型 14 | model->setEditStrategy(QSqlTableModel::OnManualSubmit); // 设置编辑策略为手动提交 15 | model->setTable("journey"); 16 | model->setHeaderData(0, Qt::Orientation::Horizontal, "序号"); 17 | model->setHeaderData(1, Qt::Orientation::Horizontal, "身份证号"); 18 | model->setHeaderData(2, Qt::Orientation::Horizontal, "姓名"); 19 | model->setHeaderData(3, Qt::Orientation::Horizontal, "始发省份"); 20 | model->setHeaderData(4, Qt::Orientation::Horizontal, "始发城市"); 21 | model->setHeaderData(5, Qt::Orientation::Horizontal, "终点省份"); 22 | model->setHeaderData(6, Qt::Orientation::Horizontal, "终点城市"); 23 | model->setHeaderData(7, Qt::Orientation::Horizontal, "席别"); 24 | model->setHeaderData(8, Qt::Orientation::Horizontal, "始发时间"); 25 | model->setHeaderData(9, Qt::Orientation::Horizontal, "价格"); 26 | model->setHeaderData(10, Qt::Orientation::Horizontal, "购票时间"); 27 | model->select();//显示数据库表 28 | model->setEditStrategy(QSqlTableModel::OnManualSubmit); // 设置编辑策略 29 | ui->tableView->setModel(model);//显示模型的位置 30 | connect(ui->logout,QPushButton::clicked,this,this->sendShowSignal); 31 | connect(this->confirm,this->confirm->confirm,this,this->confirmDelete); 32 | connect(this->confirm,this->confirm->nconfirm,this,this->nConfirmDelete); 33 | ui->stackedWidget->setCurrentIndex(0); 34 | } 35 | 36 | subwindow::~subwindow() 37 | { 38 | delete ui; 39 | } 40 | 41 | void subwindow::sendShowSignal() 42 | { 43 | emit showForm(); 44 | } 45 | 46 | void subwindow::setPassengerText() 47 | { 48 | ui->nameShow->setText(this->nowPassenger.getName()); 49 | ui->idShow->setText(this->nowPassenger.getId()); 50 | } 51 | 52 | void subwindow::confirmDelete() 53 | { 54 | int number=ui->refundLineEdit->text().toInt(); 55 | QString sql=QString("delete from journey where number='%1'").arg(number); 56 | QSqlDatabase::database().transaction(); 57 | QSqlQuery query; 58 | query.exec(sql); 59 | model->submitAll(); 60 | model->database().commit(); 61 | QMessageBox::information(this->confirm,"退票","退票成功",QMessageBox::Ok); 62 | this->confirm->hide(); 63 | } 64 | 65 | void subwindow::nConfirmDelete() 66 | { 67 | this->confirm->close(); 68 | } 69 | 70 | QSqlTableModel *subwindow::getModel() 71 | { 72 | return this->model; 73 | } 74 | 75 | passenger& subwindow::getNowPassenger() 76 | { 77 | return this->nowPassenger; 78 | } 79 | 80 | void subwindow::on_buy_clicked(bool checked) 81 | { 82 | ui->stackedWidget->setCurrentIndex(0); 83 | } 84 | 85 | void subwindow::on_refund_clicked(bool checked) 86 | { 87 | ui->stackedWidget->setCurrentIndex(1); 88 | } 89 | 90 | void subwindow::on_endorse_clicked(bool checked) 91 | { 92 | ui->stackedWidget->setCurrentIndex(2); 93 | QMessageBox::information(this,"操作提示","请先在列表中选取您要修改的始发时间\n再在日历中选择您要改签的时间",QMessageBox::Ok); 94 | } 95 | 96 | void subwindow::on_startProvince_currentTextChanged(const QString &arg1) 97 | { 98 | if(arg1=="北京"){ 99 | QStringList beijingCity; 100 | beijingCity<<"北京"; 101 | ui->startCity->clear(); 102 | ui->startCity->addItems(beijingCity); 103 | } 104 | if(arg1=="河北"){ 105 | QStringList hebeiCity; 106 | hebeiCity<<"石家庄"<<"保定"<<"秦皇岛"; 107 | ui->startCity->clear(); 108 | ui->startCity->addItems(hebeiCity); 109 | } 110 | } 111 | 112 | void subwindow::on_endProvince_currentTextChanged(const QString &arg1) 113 | { 114 | if(arg1=="北京"){ 115 | QStringList beijingCity; 116 | beijingCity<<"北京"; 117 | ui->endCity->clear(); 118 | ui->endCity->addItems(beijingCity); 119 | } 120 | if(arg1=="河北"){ 121 | QStringList hebeiCity; 122 | hebeiCity<<"石家庄"<<"保定"<<"秦皇岛"; 123 | ui->endCity->clear(); 124 | ui->endCity->addItems(hebeiCity); 125 | } 126 | } 127 | 128 | void subwindow::on_purchaseButton_clicked(bool checked) 129 | { 130 | if(ui->calendarWidget->selectedDate()startCity->currentText()==ui->endCity->currentText()){ 133 | QMessageBox::warning(this,"错误","您选择的始发站和终点站相同",QMessageBox::Cancel); 134 | }else{ 135 | for(int i=ui->numberSpinBox->text().toInt();i!=0;--i){ 136 | QString id=this->nowPassenger.getId(); 137 | QString name=this->nowPassenger.getName(); 138 | QString startPro=ui->startProvince->currentText(); 139 | QString startCity=ui->startCity->currentText(); 140 | QString endPro=ui->endProvince->currentText(); 141 | QString endCity=ui->endCity->currentText(); 142 | QString seat=ui->seatComboBox->currentText(); 143 | QString startTime=ui->calendarWidget->selectedDate().toString("yyyy-MM-dd"); 144 | int price; 145 | switch(ui->seatComboBox->currentIndex()){ 146 | case 0: 147 | price=150; 148 | break; 149 | case 1: 150 | price=300; 151 | break; 152 | case 2: 153 | price=50; 154 | break; 155 | case 3: 156 | price=500; 157 | } 158 | QString purchaseTime=QDate::currentDate().toString("yyyy-MM-dd"); 159 | int row=model->rowCount(); 160 | model->insertRow(row); 161 | model->setData(model->index(row,1),id); 162 | model->setData(model->index(row,2),name); 163 | model->setData(model->index(row,3),startPro); 164 | model->setData(model->index(row,4),startCity); 165 | model->setData(model->index(row,5),endPro); 166 | model->setData(model->index(row,6),endCity); 167 | model->setData(model->index(row,7),seat); 168 | model->setData(model->index(row,8),startTime); 169 | model->setData(model->index(row,9),price); 170 | model->setData(model->index(row,10),purchaseTime); 171 | // 开始事务操作 172 | model->database().transaction(); 173 | if (model->submitAll()) { 174 | model->database().commit(); //提交 175 | QMessageBox::information(this,"购票","购票成功",QMessageBox::Ok); 176 | } else { 177 | model->database().rollback(); //回滚 178 | QMessageBox::warning(this, tr("购票"), 179 | tr("数据库错误: %1").arg(model->lastError().text())); 180 | } 181 | } 182 | } 183 | } 184 | 185 | void subwindow::on_priceShowButton_clicked(bool checked) 186 | { 187 | if(ui->calendarWidget->selectedDate()startCity->currentText()==ui->endCity->currentText()){ 190 | QMessageBox::warning(this,"错误","您选择的始发站和终点站相同",QMessageBox::Cancel); 191 | }else{ 192 | int amount=ui->numberSpinBox->text().toInt(); 193 | int price; 194 | switch(ui->seatComboBox->currentIndex()){ 195 | case 0: 196 | price=150*amount; 197 | break; 198 | case 1: 199 | price=300*amount; 200 | break; 201 | case 2: 202 | price=50*amount; 203 | break; 204 | case 3: 205 | price=500*amount; 206 | break; 207 | } 208 | ui->priceShowLable->setText(QString::number(price)); 209 | } 210 | } 211 | 212 | void subwindow::on_refundButton_clicked(bool checked) 213 | { 214 | this->confirm->show(); 215 | } 216 | 217 | void subwindow::on_submitPushButton_clicked() 218 | { 219 | if(ui->calendarWidget_2->selectedDate()index.column()!=8){ 222 | QMessageBox::warning(this,"错误","您只能修改始发时间",QMessageBox::Cancel); 223 | }else{ 224 | QString startTime=ui->calendarWidget_2->selectedDate().toString("yyyy-MM-dd"); 225 | this->model->setData(this->index,startTime); 226 | model->database().transaction(); 227 | model->submitAll(); 228 | model->database().commit(); //提交 229 | QMessageBox::information(this,"改签","改签成功",QMessageBox::Ok); 230 | } 231 | } 232 | 233 | void subwindow::on_CancelPushButton_clicked() 234 | { 235 | model->database().rollback(); //回滚 236 | model->revertAll(); 237 | QMessageBox::information(this,"改签","您已放弃改签",QMessageBox::Ok); 238 | } 239 | 240 | void subwindow::on_tableView_clicked(const QModelIndex &index) 241 | { 242 | this->index=index; 243 | } 244 | -------------------------------------------------------------------------------- /triwindow.cpp: -------------------------------------------------------------------------------- 1 | #include "triwindow.h" 2 | #include "ui_triwindow.h" 3 | 4 | triwindow::triwindow(QWidget *parent) : 5 | QWidget(parent), 6 | ui(new Ui::triwindow) 7 | { 8 | ui->setupUi(this); 9 | this->initManagerAccount="123456"; 10 | this->initManagerPassword="000000"; 11 | setWindowTitle("管理员端"); 12 | connect(ui->backPushButton,QPushButton::clicked,this,this->sendShowSignal); 13 | ui->numberSpinBox->setMinimum(1); 14 | ui->numberSpinBox->setMaximum(5); 15 | this->model = new QSqlTableModel(this);//一个数据库表可视化模型 16 | model->setEditStrategy(QSqlTableModel::OnManualSubmit); // 设置编辑策略为手动提交 17 | model->setTable("journey"); 18 | model->setHeaderData(0, Qt::Orientation::Horizontal, "序号"); 19 | model->setHeaderData(1, Qt::Orientation::Horizontal, "身份证号"); 20 | model->setHeaderData(2, Qt::Orientation::Horizontal, "姓名"); 21 | model->setHeaderData(3, Qt::Orientation::Horizontal, "始发省份"); 22 | model->setHeaderData(4, Qt::Orientation::Horizontal, "始发城市"); 23 | model->setHeaderData(5, Qt::Orientation::Horizontal, "终点省份"); 24 | model->setHeaderData(6, Qt::Orientation::Horizontal, "终点城市"); 25 | model->setHeaderData(7, Qt::Orientation::Horizontal, "席别"); 26 | model->setHeaderData(8, Qt::Orientation::Horizontal, "始发时间"); 27 | model->setHeaderData(9, Qt::Orientation::Horizontal, "价格"); 28 | model->setHeaderData(10, Qt::Orientation::Horizontal, "购票时间"); 29 | model->select();//显示数据库表 30 | model->setEditStrategy(QSqlTableModel::OnManualSubmit); // 设置编辑策略 31 | ui->tableView->setModel(model);//显示模型的位置 32 | ui->stackedWidget_2->setCurrentIndex(0); 33 | } 34 | 35 | triwindow::~triwindow() 36 | { 37 | delete ui; 38 | } 39 | 40 | QString triwindow::getInitManagerAccount()const 41 | { 42 | return this->initManagerAccount; 43 | } 44 | 45 | QString triwindow::getInitManagerPassword()const 46 | { 47 | return this->initManagerPassword; 48 | } 49 | 50 | void triwindow::sendShowSignal() 51 | { 52 | emit showForm(); 53 | } 54 | 55 | void triwindow::on_addPushButton_clicked() 56 | { 57 | ui->stackedWidget_2->setCurrentIndex(0); 58 | } 59 | 60 | void triwindow::on_deletePushButton_clicked() 61 | { 62 | ui->stackedWidget_2->setCurrentIndex(1); 63 | QMessageBox::information(this,"提示","删除后请点击保存\n但保存后不可恢复",QMessageBox::Ok); 64 | } 65 | 66 | void triwindow::on_searchPushButton_clicked() 67 | { 68 | ui->stackedWidget_2->setCurrentIndex(3); 69 | } 70 | 71 | void triwindow::on_modifyPushButton_clicked() 72 | { 73 | QMessageBox::information(this,"提示","请直接在右侧列表中进行修改\n然后点击保存",QMessageBox::Ok); 74 | } 75 | 76 | void triwindow::on_statisticPushButton_clicked() 77 | { 78 | ui->stackedWidget_2->setCurrentIndex(5); 79 | } 80 | 81 | void triwindow::on_startProvince_currentTextChanged(const QString &arg1) 82 | { 83 | if(arg1=="北京"){ 84 | QStringList beijingCity; 85 | beijingCity<<"北京"; 86 | ui->startCity->clear(); 87 | ui->startCity->addItems(beijingCity); 88 | } 89 | if(arg1=="河北"){ 90 | QStringList hebeiCity; 91 | hebeiCity<<"石家庄"<<"保定"<<"秦皇岛"; 92 | ui->startCity->clear(); 93 | ui->startCity->addItems(hebeiCity); 94 | } 95 | } 96 | 97 | void triwindow::on_endProvince_currentTextChanged(const QString &arg1) 98 | { 99 | if(arg1=="北京"){ 100 | QStringList beijingCity; 101 | beijingCity<<"北京"; 102 | ui->endCity->clear(); 103 | ui->endCity->addItems(beijingCity); 104 | } 105 | if(arg1=="河北"){ 106 | QStringList hebeiCity; 107 | hebeiCity<<"石家庄"<<"保定"<<"秦皇岛"; 108 | ui->endCity->clear(); 109 | ui->endCity->addItems(hebeiCity); 110 | } 111 | } 112 | 113 | void triwindow::on_addPushButton_2_clicked() 114 | { 115 | bool ismatch=true; 116 | for(int i=0;imodel->rowCount();++i){ 117 | if(this->model->record(i).value(1)==ui->passengerId->text()&&this->model->record(i).value(2)!=ui->passengerName->text()){ 118 | ismatch=false; 119 | } 120 | } 121 | if(ui->calendarWidget->selectedDate()passengerName->text()==NULL){ 124 | QMessageBox::warning(this,"错误","您未填写购票人姓名",QMessageBox::Cancel); 125 | }else if(ui->passengerId->text()==NULL){ 126 | QMessageBox::warning(this,"错误","您未填写购票人身份证号",QMessageBox::Cancel); 127 | }else if(ui->startCity->currentText()==NULL){ 128 | QMessageBox::warning(this,"错误","您未选择始发城市",QMessageBox::Cancel); 129 | }else if(ui->endCity->currentText()==NULL){ 130 | QMessageBox::warning(this,"错误","您未选择终点城市",QMessageBox::Cancel); 131 | }else if(ui->startCity->currentText()==ui->endCity->currentText()){ 132 | QMessageBox::warning(this,"错误","您选择的始发站和终点站相同",QMessageBox::Cancel); 133 | }else if(!ismatch){ 134 | QMessageBox::warning(this,"错误","您的购票人姓名与身份证号不匹配",QMessageBox::Cancel); 135 | }else{ 136 | for(int i=ui->numberSpinBox->text().toInt();i!=0;--i){ 137 | QString id=ui->passengerName->text(); 138 | QString name=ui->passengerId->text(); 139 | QString startPro=ui->startProvince->currentText(); 140 | QString startCity=ui->startCity->currentText(); 141 | QString endPro=ui->endProvince->currentText(); 142 | QString endCity=ui->endCity->currentText(); 143 | QString seat=ui->seatComboBox->currentText(); 144 | QString startTime=ui->calendarWidget->selectedDate().toString("yyyy-MM-dd"); 145 | int price; 146 | switch(ui->seatComboBox->currentIndex()){ 147 | case 0: 148 | price=150; 149 | break; 150 | case 1: 151 | price=300; 152 | break; 153 | case 2: 154 | price=50; 155 | break; 156 | case 3: 157 | price=500; 158 | } 159 | QString purchaseTime=QDate::currentDate().toString("yyyy-MM-dd"); 160 | int row=model->rowCount(); 161 | model->insertRow(row); 162 | model->setData(model->index(row,1),id); 163 | model->setData(model->index(row,2),name); 164 | model->setData(model->index(row,3),startPro); 165 | model->setData(model->index(row,4),startCity); 166 | model->setData(model->index(row,5),endPro); 167 | model->setData(model->index(row,6),endCity); 168 | model->setData(model->index(row,7),seat); 169 | model->setData(model->index(row,8),startTime); 170 | model->setData(model->index(row,9),price); 171 | model->setData(model->index(row,10),purchaseTime); 172 | // 开始事务操作 173 | model->database().transaction(); 174 | if (model->submitAll()) { 175 | model->database().commit(); //提交 176 | QMessageBox::information(this,"添加","添加购票记录成功",QMessageBox::Ok); 177 | } else { 178 | model->database().rollback(); //回滚 179 | QMessageBox::warning(this, tr("添加"), 180 | tr("数据库错误: %1").arg(model->lastError().text())); 181 | } 182 | } 183 | } 184 | } 185 | 186 | void triwindow::on_deletePushButton_2_clicked() 187 | { 188 | int number=ui->deletLineEdit->text().toInt(); 189 | this->model->setFilter(QObject::tr("number!='%1'").arg(number)); 190 | this->model->select(); 191 | this->deletList.append(number); 192 | QMessageBox::information(this,"删除","删除成功",QMessageBox::Ok); 193 | } 194 | 195 | void triwindow::on_recoverPushButton_clicked() 196 | { 197 | this->model->setFilter(NULL); 198 | this->model->select(); 199 | this->deletList.clear(); 200 | QMessageBox::information(this,"恢复","恢复成功",QMessageBox::Ok); 201 | } 202 | 203 | void triwindow::on_savePushButton_clicked() 204 | { 205 | for(int i=0;ideletList.count();++i){ 206 | QString sql=QString("delete from journey where number='%1'").arg(this->deletList.at(i)); 207 | QSqlQuery query; 208 | query.exec(sql); 209 | model->submitAll(); 210 | } 211 | model->submitAll(); 212 | model->database().commit(); 213 | this->deletList.clear(); 214 | QMessageBox::information(this,"保存","保存成功",QMessageBox::Ok); 215 | } 216 | 217 | void triwindow::on_mannerComboBox_currentTextChanged(const QString &arg1) 218 | { 219 | if(arg1=="身份证号"){ 220 | ui->mannerLabel->setText("身份证号"); 221 | }else{ 222 | ui->mannerLabel->setText("姓名"); 223 | } 224 | } 225 | 226 | void triwindow::on_searchPushButton_2_clicked() 227 | { 228 | if(ui->mannerComboBox->currentText()=="身份证号"){ 229 | int id=ui->searchLineEdit->text().toInt(); 230 | this->model->setFilter(QObject::tr("id='%1'").arg(id)); 231 | this->model->select(); 232 | if(this->model->rowCount()==0){ 233 | QMessageBox::information(this,"查询","查询内容为空",QMessageBox::Ok); 234 | } 235 | }else{ 236 | QString name=ui->searchLineEdit->text(); 237 | this->model->setFilter(QObject::tr("name='%1'").arg(name)); 238 | this->model->select(); 239 | if(this->model->rowCount()==0){ 240 | QMessageBox::information(this,"查询","查询内容为空",QMessageBox::Ok); 241 | } 242 | } 243 | } 244 | 245 | void triwindow::on_showAll_clicked() 246 | { 247 | this->model->setFilter(NULL); 248 | this->model->select(); 249 | } 250 | 251 | void triwindow::on_statisticPushButton_2_clicked() 252 | { 253 | int count=0; 254 | int price=0; 255 | int count1=0;//小于100 256 | int count2=0;//100-400 257 | int count3=0;//大于400 258 | int price1=0;//小于100 259 | int price2=0;//100-400 260 | int price3=0;//大于400 261 | 262 | for(int i=0;imodel->rowCount();++i){ 263 | if(this->model->record(i).value(10)==ui->calendarWidget_3->selectedDate().toString("yyyy-MM-dd")){ 264 | ++count; 265 | price+=this->model->record(i).value(9).toInt(); 266 | } 267 | } 268 | ui->showAmountLabel->setText(QString::number(count)+"张"); 269 | ui->showMoneyLabel->setText(QString::number(price)+"元"); 270 | 271 | for(int i=0;imodel->rowCount();++i){ 272 | if(this->model->record(i).value(9).toInt()<100){ 273 | ++count1; 274 | price1+=this->model->record(i).value(9).toInt(); 275 | } 276 | if(this->model->record(i).value(9).toInt()<=400&&this->model->record(i).value(9).toInt()>=100){ 277 | ++count2; 278 | price2+=this->model->record(i).value(9).toInt(); 279 | } 280 | if(this->model->record(i).value(9).toInt()>=400){ 281 | ++count3; 282 | price3+=this->model->record(i).value(9).toInt(); 283 | } 284 | } 285 | if(ui->priceComboBox->currentText()=="小于100元"){ 286 | ui->showAmountLabel_2->setText(QString::number(count1)+"张"); 287 | ui->showMoenyLabel_2->setText(QString::number(price1)+"元"); 288 | } 289 | if(ui->priceComboBox->currentText()=="大于等于100元且小于等于400元"){ 290 | ui->showAmountLabel_2->setText(QString::number(count2)+"张"); 291 | ui->showMoenyLabel_2->setText(QString::number(price2)+"元"); 292 | } 293 | if(ui->priceComboBox->currentText()=="大于400元"){ 294 | ui->showAmountLabel_2->setText(QString::number(count3)+"张"); 295 | ui->showMoenyLabel_2->setText(QString::number(price3)+"元"); 296 | } 297 | } 298 | -------------------------------------------------------------------------------- /subwindow.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | subwindow 4 | 5 | 6 | 7 | 0 8 | 0 9 | 722 10 | 620 11 | 12 | 13 | 14 | Form 15 | 16 | 17 | 18 | 19 | 20 | Qt::Horizontal 21 | 22 | 23 | 24 | 乘客 25 | 26 | 27 | 28 | 29 | 30 | 当前账号 31 | 32 | 33 | 34 | 35 | 36 | 姓名 37 | 38 | 39 | 40 | 41 | 42 | 43 | TextLabel 44 | 45 | 46 | 47 | 48 | 49 | 50 | 身份证号 51 | 52 | 53 | 54 | 55 | 56 | 57 | TextLabel 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 操作 68 | 69 | 70 | 71 | 72 | 73 | 购票 74 | 75 | 76 | 77 | 78 | 79 | 80 | 退票 81 | 82 | 83 | 84 | 85 | 86 | 87 | 改签 88 | 89 | 90 | 91 | 92 | 93 | 94 | 退出账户 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 0 105 | 106 | 107 | 108 | 109 | 110 | 111 | 购票 112 | 113 | 114 | 115 | 116 | 117 | 始发站 118 | 119 | 120 | Qt::AutoText 121 | 122 | 123 | 124 | 125 | 126 | 127 | 席别 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 北京 136 | 137 | 138 | 139 | 140 | 河北 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 硬座 153 | 154 | 155 | 156 | 157 | 卧铺 158 | 159 | 160 | 161 | 162 | 站票 163 | 164 | 165 | 166 | 167 | 动车 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 终点站 176 | 177 | 178 | 179 | 180 | 181 | 182 | 购票张数 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 北京 191 | 192 | 193 | 194 | 195 | 河北 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 显示价格 213 | 214 | 215 | 216 | 217 | 218 | 219 | 购买 220 | 221 | 222 | 223 | 224 | 225 | 226 | Qt::LeftToRight 227 | 228 | 229 | QFrame::Box 230 | 231 | 232 | QFrame::Plain 233 | 234 | 235 | 1 236 | 237 | 238 | 0 239 | 240 | 241 | 0¥ 242 | 243 | 244 | Qt::AutoText 245 | 246 | 247 | Qt::AlignCenter 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 退票 262 | 263 | 264 | 265 | 266 | 267 | 输入序号 268 | 269 | 270 | 271 | 272 | 273 | 274 | 0 275 | 276 | 277 | true 278 | 279 | 280 | Qt::AlignCenter 281 | 282 | 283 | 284 | 285 | 286 | 287 | 退票 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 改签 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 提交 311 | 312 | 313 | 314 | 315 | 316 | 317 | 放弃 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | -------------------------------------------------------------------------------- /triwindow.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | triwindow 4 | 5 | 6 | 7 | 0 8 | 0 9 | 843 10 | 671 11 | 12 | 13 | 14 | Form 15 | 16 | 17 | 18 | 19 | 20 | Qt::Horizontal 21 | 22 | 23 | 24 | 管理员 25 | 26 | 27 | 28 | 29 | 30 | 操作 31 | 32 | 33 | 34 | 35 | 36 | 添加 37 | 38 | 39 | 40 | 41 | 42 | 43 | 删除 44 | 45 | 46 | 47 | 48 | 49 | 50 | 恢复 51 | 52 | 53 | 54 | 55 | 56 | 57 | 查询 58 | 59 | 60 | 61 | 62 | 63 | 64 | 保存 65 | 66 | 67 | 68 | 69 | 70 | 71 | 统计 72 | 73 | 74 | 75 | 76 | 77 | 78 | 修改 79 | 80 | 81 | 82 | 83 | 84 | 85 | 返回 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 5 96 | 97 | 98 | 99 | 100 | 101 | 102 | 添加 103 | 104 | 105 | 106 | 107 | 108 | 身份证号 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 北京 117 | 118 | 119 | 120 | 121 | 河北 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 姓名 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 硬座 141 | 142 | 143 | 144 | 145 | 卧铺 146 | 147 | 148 | 149 | 150 | 站票 151 | 152 | 153 | 154 | 155 | 高铁 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 终点站 164 | 165 | 166 | 167 | 168 | 169 | 170 | 席别 171 | 172 | 173 | 174 | 175 | 176 | 177 | 始发站 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 北京 189 | 190 | 191 | 192 | 193 | 河北 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 添加 211 | 212 | 213 | 214 | 215 | 216 | 217 | 购票张数 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 删除 235 | 236 | 237 | 238 | 239 | 240 | 输入序号 241 | 242 | 243 | 244 | 245 | 246 | 247 | 0 248 | 249 | 250 | Qt::AlignCenter 251 | 252 | 253 | 254 | 255 | 256 | 257 | 删除 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 查询 273 | 274 | 275 | 276 | 277 | 278 | 查找方式 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 身份证号 287 | 288 | 289 | 290 | 291 | 姓名 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 身份证号 300 | 301 | 302 | Qt::AlignCenter 303 | 304 | 305 | 306 | 307 | 308 | 309 | Qt::AlignCenter 310 | 311 | 312 | 313 | 314 | 315 | 316 | 查询 317 | 318 | 319 | 320 | 321 | 322 | 323 | 显示全部 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | GroupBox 338 | 339 | 340 | 341 | 342 | 343 | 请直接在右侧列表中进行修改,然后点击保存 344 | 345 | 346 | Qt::AlignCenter 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 统计 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 当日订票张数 370 | 371 | 372 | Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter 373 | 374 | 375 | 376 | 377 | 378 | 379 | 0张 380 | 381 | 382 | Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 383 | 384 | 385 | 386 | 387 | 388 | 389 | 当日订票总金额 390 | 391 | 392 | Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter 393 | 394 | 395 | 396 | 397 | 398 | 399 | 0¥ 400 | 401 | 402 | Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 403 | 404 | 405 | 406 | 407 | 408 | 409 | 统计单价 410 | 411 | 412 | Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter 413 | 414 | 415 | 416 | 417 | 418 | 419 | 0¥ 420 | 421 | 422 | Qt::AlignCenter 423 | 424 | 425 | 426 | 427 | 428 | 429 | 统计 430 | 431 | 432 | 433 | 434 | 435 | 436 | 437 | 小于100元 438 | 439 | 440 | 441 | 442 | 大于等于100元且小于等于400元 443 | 444 | 445 | 446 | 447 | 大于400元 448 | 449 | 450 | 451 | 452 | 453 | 454 | 455 | 0张 456 | 457 | 458 | Qt::AlignCenter 459 | 460 | 461 | 462 | 463 | 464 | 465 | 466 | 467 | 468 | 469 | 470 | 471 | 472 | 473 | 474 | 475 | 476 | 477 | 478 | 479 | -------------------------------------------------------------------------------- /TrainTicketManage.pro.user: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | EnvironmentId 7 | {c5e4e388-d941-4c12-b963-27afa0f61b3e} 8 | 9 | 10 | ProjectExplorer.Project.ActiveTarget 11 | 0 12 | 13 | 14 | ProjectExplorer.Project.EditorSettings 15 | 16 | true 17 | false 18 | true 19 | 20 | Cpp 21 | 22 | CppGlobal 23 | 24 | 25 | 26 | QmlJS 27 | 28 | QmlJSGlobal 29 | 30 | 31 | 2 32 | UTF-8 33 | false 34 | 4 35 | false 36 | 80 37 | true 38 | true 39 | 1 40 | true 41 | false 42 | 0 43 | true 44 | true 45 | 0 46 | 8 47 | true 48 | 1 49 | true 50 | true 51 | true 52 | false 53 | 54 | 55 | 56 | ProjectExplorer.Project.PluginSettings 57 | 58 | 59 | 60 | ProjectExplorer.Project.Target.0 61 | 62 | Desktop Qt 5.9.0 MinGW 32bit 63 | Desktop Qt 5.9.0 MinGW 32bit 64 | qt.59.win32_mingw53_kit 65 | 0 66 | 0 67 | 0 68 | 69 | D:/qt/build-TrainTicketManage-Desktop_Qt_5_9_0_MinGW_32bit-Debug 70 | 71 | 72 | true 73 | qmake 74 | 75 | QtProjectManager.QMakeBuildStep 76 | true 77 | 78 | false 79 | false 80 | false 81 | 82 | 83 | true 84 | Make 85 | 86 | Qt4ProjectManager.MakeStep 87 | 88 | false 89 | 90 | 91 | 92 | 2 93 | 构建 94 | 95 | ProjectExplorer.BuildSteps.Build 96 | 97 | 98 | 99 | true 100 | Make 101 | 102 | Qt4ProjectManager.MakeStep 103 | 104 | true 105 | clean 106 | 107 | 108 | 1 109 | 清理 110 | 111 | ProjectExplorer.BuildSteps.Clean 112 | 113 | 2 114 | false 115 | 116 | Debug 117 | 118 | Qt4ProjectManager.Qt4BuildConfiguration 119 | 2 120 | true 121 | 122 | 123 | D:/qt/build-TrainTicketManage-Desktop_Qt_5_9_0_MinGW_32bit-Release 124 | 125 | 126 | true 127 | qmake 128 | 129 | QtProjectManager.QMakeBuildStep 130 | false 131 | 132 | false 133 | false 134 | false 135 | 136 | 137 | true 138 | Make 139 | 140 | Qt4ProjectManager.MakeStep 141 | 142 | false 143 | 144 | 145 | 146 | 2 147 | 构建 148 | 149 | ProjectExplorer.BuildSteps.Build 150 | 151 | 152 | 153 | true 154 | Make 155 | 156 | Qt4ProjectManager.MakeStep 157 | 158 | true 159 | clean 160 | 161 | 162 | 1 163 | 清理 164 | 165 | ProjectExplorer.BuildSteps.Clean 166 | 167 | 2 168 | false 169 | 170 | Release 171 | 172 | Qt4ProjectManager.Qt4BuildConfiguration 173 | 0 174 | true 175 | 176 | 177 | D:/qt/build-TrainTicketManage-Desktop_Qt_5_9_0_MinGW_32bit-Profile 178 | 179 | 180 | true 181 | qmake 182 | 183 | QtProjectManager.QMakeBuildStep 184 | true 185 | 186 | false 187 | true 188 | false 189 | 190 | 191 | true 192 | Make 193 | 194 | Qt4ProjectManager.MakeStep 195 | 196 | false 197 | 198 | 199 | 200 | 2 201 | 构建 202 | 203 | ProjectExplorer.BuildSteps.Build 204 | 205 | 206 | 207 | true 208 | Make 209 | 210 | Qt4ProjectManager.MakeStep 211 | 212 | true 213 | clean 214 | 215 | 216 | 1 217 | 清理 218 | 219 | ProjectExplorer.BuildSteps.Clean 220 | 221 | 2 222 | false 223 | 224 | Profile 225 | 226 | Qt4ProjectManager.Qt4BuildConfiguration 227 | 0 228 | true 229 | 230 | 3 231 | 232 | 233 | 0 234 | 部署 235 | 236 | ProjectExplorer.BuildSteps.Deploy 237 | 238 | 1 239 | 在本地部署 240 | 241 | ProjectExplorer.DefaultDeployConfiguration 242 | 243 | 1 244 | 245 | 246 | false 247 | false 248 | 1000 249 | 250 | true 251 | 252 | false 253 | false 254 | false 255 | false 256 | true 257 | 0.01 258 | 10 259 | true 260 | 1 261 | 25 262 | 263 | 1 264 | true 265 | false 266 | true 267 | valgrind 268 | 269 | 0 270 | 1 271 | 2 272 | 3 273 | 4 274 | 5 275 | 6 276 | 7 277 | 8 278 | 9 279 | 10 280 | 11 281 | 12 282 | 13 283 | 14 284 | 285 | 2 286 | 287 | TrainTicketManage 288 | TrainTicketManage2 289 | Qt4ProjectManager.Qt4RunConfiguration:D:/git_repository/train_ticket_manage_QtApplication/TrainTicketManage.pro 290 | true 291 | 292 | TrainTicketManage.pro 293 | false 294 | 295 | D:/qt/build-TrainTicketManage-Desktop_Qt_5_9_0_MinGW_32bit-Debug 296 | 3768 297 | false 298 | true 299 | false 300 | false 301 | true 302 | 303 | 1 304 | 305 | 306 | 307 | ProjectExplorer.Project.Target.1 308 | 309 | Desktop Qt 5.9.0 MSVC2017 64bit 310 | Desktop Qt 5.9.0 MSVC2017 64bit 311 | qt.59.win64_msvc2017_64_kit 312 | 0 313 | 0 314 | 0 315 | 316 | D:/qt/build-TrainTicketManage-Desktop_Qt_5_9_0_MSVC2017_64bit-Debug 317 | 318 | 319 | true 320 | qmake 321 | 322 | QtProjectManager.QMakeBuildStep 323 | true 324 | 325 | false 326 | false 327 | false 328 | 329 | 330 | true 331 | Make 332 | 333 | Qt4ProjectManager.MakeStep 334 | 335 | false 336 | 337 | 338 | 339 | 2 340 | 构建 341 | 342 | ProjectExplorer.BuildSteps.Build 343 | 344 | 345 | 346 | true 347 | Make 348 | 349 | Qt4ProjectManager.MakeStep 350 | 351 | true 352 | clean 353 | 354 | 355 | 1 356 | 清理 357 | 358 | ProjectExplorer.BuildSteps.Clean 359 | 360 | 2 361 | false 362 | 363 | Debug 364 | 365 | Qt4ProjectManager.Qt4BuildConfiguration 366 | 2 367 | true 368 | 369 | 370 | D:/qt/build-TrainTicketManage-Desktop_Qt_5_9_0_MSVC2017_64bit-Release 371 | 372 | 373 | true 374 | qmake 375 | 376 | QtProjectManager.QMakeBuildStep 377 | false 378 | 379 | false 380 | false 381 | false 382 | 383 | 384 | true 385 | Make 386 | 387 | Qt4ProjectManager.MakeStep 388 | 389 | false 390 | 391 | 392 | 393 | 2 394 | 构建 395 | 396 | ProjectExplorer.BuildSteps.Build 397 | 398 | 399 | 400 | true 401 | Make 402 | 403 | Qt4ProjectManager.MakeStep 404 | 405 | true 406 | clean 407 | 408 | 409 | 1 410 | 清理 411 | 412 | ProjectExplorer.BuildSteps.Clean 413 | 414 | 2 415 | false 416 | 417 | Release 418 | 419 | Qt4ProjectManager.Qt4BuildConfiguration 420 | 0 421 | true 422 | 423 | 424 | D:/qt/build-TrainTicketManage-Desktop_Qt_5_9_0_MSVC2017_64bit-Profile 425 | 426 | 427 | true 428 | qmake 429 | 430 | QtProjectManager.QMakeBuildStep 431 | true 432 | 433 | false 434 | true 435 | false 436 | 437 | 438 | true 439 | Make 440 | 441 | Qt4ProjectManager.MakeStep 442 | 443 | false 444 | 445 | 446 | 447 | 2 448 | 构建 449 | 450 | ProjectExplorer.BuildSteps.Build 451 | 452 | 453 | 454 | true 455 | Make 456 | 457 | Qt4ProjectManager.MakeStep 458 | 459 | true 460 | clean 461 | 462 | 463 | 1 464 | 清理 465 | 466 | ProjectExplorer.BuildSteps.Clean 467 | 468 | 2 469 | false 470 | 471 | Profile 472 | 473 | Qt4ProjectManager.Qt4BuildConfiguration 474 | 0 475 | true 476 | 477 | 3 478 | 479 | 480 | 0 481 | 部署 482 | 483 | ProjectExplorer.BuildSteps.Deploy 484 | 485 | 1 486 | 在本地部署 487 | 488 | ProjectExplorer.DefaultDeployConfiguration 489 | 490 | 1 491 | 492 | 493 | false 494 | false 495 | 1000 496 | 497 | true 498 | 499 | false 500 | false 501 | false 502 | false 503 | true 504 | 0.01 505 | 10 506 | true 507 | 1 508 | 25 509 | 510 | 1 511 | true 512 | false 513 | true 514 | valgrind 515 | 516 | 0 517 | 1 518 | 2 519 | 3 520 | 4 521 | 5 522 | 6 523 | 7 524 | 8 525 | 9 526 | 10 527 | 11 528 | 12 529 | 13 530 | 14 531 | 532 | 2 533 | 534 | 535 | 536 | %{buildDir} 537 | Custom Executable 538 | 539 | ProjectExplorer.CustomExecutableRunConfiguration 540 | 3768 541 | false 542 | true 543 | false 544 | false 545 | true 546 | 547 | 1 548 | 549 | 550 | 551 | ProjectExplorer.Project.TargetCount 552 | 2 553 | 554 | 555 | ProjectExplorer.Project.Updater.FileVersion 556 | 18 557 | 558 | 559 | Version 560 | 18 561 | 562 | 563 | --------------------------------------------------------------------------------