-
Notifications
You must be signed in to change notification settings - Fork 3
/
ParkingLotWidget.h
42 lines (38 loc) · 1.06 KB
/
ParkingLotWidget.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
39
40
41
42
#ifndef PARKING_LOT_WIDGET
#define PARKING_LOT_WIDGET
#include <QWidget>
#include <QString>
#include <QVBoxLayout>
#include <QDomDocument>
#include <QVector>
#include <QContextMenuEvent>
#include <QAction>
#include "Road.h"
#include "ParkingSpaceWidget.h"
class ParkingSpaceWidget; // 先声明类,防止循环include
class Road;
class ParkingLotWidget: public QWidget
{
Q_OBJECT
public:
explicit ParkingLotWidget(QWidget* parent, const QString& xml);
int addSpace(ParkingSpaceWidget* sp);
int addRoad(Road* r);
int getCapacity() {return m_spaceList.size(); }
~ParkingLotWidget();
QString getName() const;
const QVector<ParkingSpaceWidget *>& getSpaceList() const;
const QVector<Road *>& getRoadList() const;
void showMarginSlot(bool b);
private:
QVector<ParkingSpaceWidget*> m_spaceList;
QVector<Road*> m_roadList;
void parse_xml(const QString& xml);
QBoxLayout *parseLayout(const QDomElement& element);
QBoxLayout *layout = nullptr;
QString name;
signals:
void showMargain(bool);
void banParkingSpace(bool, uint);
};
#endif