-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathParkingSpaceWidget.h
38 lines (33 loc) · 945 Bytes
/
ParkingSpaceWidget.h
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
#ifndef PARKING_SPACE_WIDGET
#define PARKING_SPACE_WIDGET
#include <QWidget>
#include <QLayout>
#include <QLabel>
#include <QMouseEvent>
#include "ParkingLotWidget.h"
class ParkingLotWidget;
class ParkingSpaceWidget: public QWidget
{
Q_OBJECT
public:
enum direction{N, S, E, W};
enum Situation{banned, occupied, free};
ParkingSpaceWidget(ParkingLotWidget* parent, const QString &dir);
static QBoxLayout* makeParkingSapceGroup(ParkingLotWidget* parent, const QString& dir, int n, const QString &expend);
~ParkingSpaceWidget();
direction getDir() const;
void mouseDoubleClickEvent(QMouseEvent *event);
int getNumber() const;
Situation getSituation() const;
void setSituation(const Situation &value);
protected:
void paintEvent(QPaintEvent* ) override;
private:
bool m_showMargin = false;
int number;
direction dir;
Situation m_situation = free;
signals:
void ban(bool, int);
};
#endif