修正状态

This commit is contained in:
hm
2020-10-11 09:33:39 +08:00
parent 68387c8905
commit e2622fad9f
5 changed files with 320 additions and 27 deletions
+37 -6
View File
@@ -54,6 +54,7 @@ MainWindow::MainWindow(QWidget *parent)
//状态
statusui = new StatusUI(this);
statusui->hide();
healthui = new HealthUI(this);
//指令
@@ -83,11 +84,13 @@ MainWindow::MainWindow(QWidget *parent)
this->width(),
this->height());
map->SetZoom(10);
qDebug() << "map start";
copk = new Cockpit(this);
copk->setGeometry(this->width() - copk->width(),0,500,500);
copk->setGeometry(this->width() - copk->width(),0,400,350);
missionUI = new propertyui(this);
@@ -331,14 +334,19 @@ void MainWindow::resizeEvent(QResizeEvent *event)
this->width()- copk->width(),this->height() - menuBarUI->height());
}
//if(MainIndex == 5)//renwu
{
if(statusui->isHidden())
map->setGeometry(0,menuBarUI->height(),
this->width()- copk->width(),this->height() - menuBarUI->height());
}
copk->setGeometry(this->width() - copk->width(),menuBarUI->height(),
copk->width(),copk->height());
healthui->setGeometry(this->width() - copk->width(),menuBarUI->height() + copk->height(),
copk->width(),200);
copk->width(),320);
statusui->setGeometry(map->width(),
@@ -546,7 +554,7 @@ void MainWindow::onTabIndexChanged(const int &index)//界面选择管理
missionUI->hide();
}
if((index == 2)||(index == 3)) map->show();
if((index == 2)||(index == 3)||(index == 5)) map->show();
else map->hide();
@@ -555,13 +563,15 @@ void MainWindow::onTabIndexChanged(const int &index)//界面选择管理
{
copk->show();
commandUI->show();
statusui->show();
//statusui->show();
healthui->show();
}
else
{
copk->hide();
commandUI->hide();
statusui->hide();
//statusui->hide();
healthui->hide();
}
@@ -570,6 +580,27 @@ void MainWindow::onTabIndexChanged(const int &index)//界面选择管理
else toolsui->hide();
if(index == 5)
{
if(statusui->isHidden())
{
copk->show();
commandUI->show();
statusui->show();
healthui->show();
}
else
{
copk->show();
commandUI->show();
statusui->hide();
healthui->show();
}
}
else
{
statusui->hide();
}
resizeEvent(nullptr);