forked from AyushR1/Parking-Management
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmainwindow.cpp
More file actions
58 lines (51 loc) · 1.31 KB
/
mainwindow.cpp
File metadata and controls
58 lines (51 loc) · 1.31 KB
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
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "enterdialog.h"
#include "leavedialog.h"
#include "parking.h"
#include <QPixmap>
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
this->setWindowTitle(QObject::tr("RGIPT Parking"));
ui->freePlaces->setText(QString::number(MAX_CAR));
ui->statusBar->showMessage("By Ayush Rathore");
extern QLabel *l1,*l2,*l3,*l4;
l1=ui->occupiedPlaces;
l2=ui->freePlaces;
l3=ui->countPas;
l4=ui->totalEarnings;
QPixmap pix("C:/Users/sunnn/Desktop/Qt-Parking-Lot-master/images/head.png");
ui->picture->setPixmap(pix.scaled(285,165,Qt::KeepAspectRatio));
}
void MainWindow::updateMessage(QString msg)
{
ui->message->append(msg);
}
MainWindow::~MainWindow()
{
delete ui;
}
void MainWindow::on_enter_clicked()
{
enterDialog enterInput(this);
enterInput.setWindowTitle("Vehicle Arival");
enterInput.exec();
}
void MainWindow::on_leave_clicked()
{
leaveDialog leaveInput(this);
leaveInput.setWindowTitle("Departure");
leaveInput.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];
}
}