显示楼层名
This commit is contained in:
1 parent
6a465355b0
commit
54ac81c2ce
4 files changed
+4
-1
No files matched your search
@@ -16,6 +16,7 @@ Monitor::Monitor(QWidget *parent) :
|
||||
QObject::connect(pk, &ParkingLotItem::enableDownButton, ui->downStairButton, &QPushButton::setEnabled);
|
||||
QObject::connect(pk, &ParkingLotItem::setCapacity, ui->capacity, &QLabel::setText);
|
||||
QObject::connect(pk, &ParkingLotItem::setLoad, ui->load, &QLabel::setText);
|
||||
QObject::connect(pk, &ParkingLotItem::setLayerName, ui->layerName, &QLabel::setText);
|
||||
|
||||
pk->showParkingLot();
|
||||
QGraphicsScene *scene = new QGraphicsScene(this); // 创建场景
|
||||
|
||||
+1
-1
@@ -72,7 +72,7 @@
|
||||
<enum>QLayout::SetDefaultConstraint</enum>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="currentFloor">
|
||||
<widget class="QLabel" name="layerName">
|
||||
<property name="text">
|
||||
<string>TextLabel</string>
|
||||
</property>
|
||||
|
||||
@@ -45,6 +45,7 @@ void ParkingLotItem::showParkingLot(uint pos)
|
||||
setPixmap(*m_pixmap.at(pos));
|
||||
emit setCapacity(QString::number(m_capacity.at(pos)));
|
||||
emit setLoad(QString::number(m_capacity.at(pos) - m_num_of_cars.at(pos)));
|
||||
emit setLayerName(m_name.at(pos));
|
||||
}
|
||||
|
||||
void ParkingLotItem::showParkingLot()
|
||||
|
||||
@@ -32,6 +32,7 @@ signals:
|
||||
void enableDownButton(bool);
|
||||
void setCapacity(const QString&);
|
||||
void setLoad(const QString&);
|
||||
void setLayerName(const QString&);
|
||||
};
|
||||
|
||||
#endif // PARKINGLOTITEM_H
|
||||
Reference in new issue
Block a user