-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmainwindow.cpp
78 lines (69 loc) · 1.85 KB
/
mainwindow.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "enterdialog.h"
#include "leavedialog.h"
#include "parkinginfo.h"
#include "carinfo.h"
#include "parking.h"
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
this->setWindowTitle(QObject::tr("停车场管理系统 汉化版"));
ui->freePlaces->setText(QString::number(MAX_CAR));
ui->statusBar->showMessage("Designed and translated by Francis Grace©2020");
extern QLabel *l1,*l2,*l3,*l4;
l1=ui->occupiedPlaces;
l2=ui->freePlaces;
l3=ui->countPas;
l4=ui->totalEarnings;
}
void MainWindow::updateMessage(QString msg)
{
ui->message->append(msg);
}
MainWindow::~MainWindow()
{
delete ui;
}
void MainWindow::on_enter_clicked()
{
enterDialog enterInput(this);
enterInput.setWindowTitle("车辆入场");
enterInput.exec();
}
void MainWindow::on_leave_clicked()
{
leaveDialog leaveInput(this);
leaveInput.setWindowTitle("车辆离场");
leaveInput.exec();
}
void MainWindow::on_checkParking_clicked()
{
extern System sys;
parkingInfo info(this);
info.setWindowTitle("场地查询");
QTableView* table=info.getTableAddress();
QStandardItemModel* model=new QStandardItemModel();
table->setModel(model);
table->setEditTriggers(QAbstractItemView::NoEditTriggers);
QTextBrowser* text=info.getTextAddress();
sys.showCondition(model,text);
info.exec();
}
void MainWindow::on_checkCar_clicked()
{
carInfo info(this);
info.setWindowTitle("车辆查询");
info.exec();
}
void MainWindow::closeEvent()
{
extern int size;
extern Car* carList[1000];
for (int i = 0; i < size; i++){
//cout<<"delete "<<carList[i]->getNumber()<<endl;
delete carList[i];
}
}