From a95cb2c1212b86132302799659c9c193933f8b5b Mon Sep 17 00:00:00 2001 From: caoyuhui <1152604503@qq.com> Date: Sat, 17 Aug 2024 14:28:26 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=89=E7=94=B5=E5=90=8A=E8=88=B1=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2bug=E4=BF=AE=E5=A4=8D=EF=BC=9B=E4=B8=BB=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E7=95=8C=E9=9D=A2=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Src/GDDC/gddcdlg.cpp | 11 +- Src/HomePage/homepagedlg.cpp | 9 +- Src/HomePage/homepagedlg.h | 6 +- Src/HomePage/homepagedlg.ui | 33 +- Src/HomePage/homepagesetingwidget.ui | 474 ++++++++++++++------------- mainwindow.cpp | 1 - mainwindow.ui | 12 +- 7 files changed, 279 insertions(+), 267 deletions(-) diff --git a/Src/GDDC/gddcdlg.cpp b/Src/GDDC/gddcdlg.cpp index 11dee2c..070132b 100644 --- a/Src/GDDC/gddcdlg.cpp +++ b/Src/GDDC/gddcdlg.cpp @@ -86,7 +86,8 @@ void GDDCdlg::initWindow() m_DlgGDDCSet = new GDDCSet(); m_GDDCCmdDlg = new GDDCCmdDlg(this); m_GDDCStateDlg = new GDDCStateInfo(this); - + ui->pushButShowStatePage->setIcon(QIcon(":/res/right.png")); + ui->pushButShowCmdPage->setIcon(QIcon(":/res/down.png")); } //初始化参数 @@ -99,8 +100,6 @@ void GDDCdlg::initParam() m_DCcmdBuffer.resize(cmdLength); detectionAreaSetting = false; connectFlag.resize(12,false); - ui->pushButShowCmdPage->setIcon(QIcon(":/res/down.png")); - ui->pushButShowStatePage->setIcon(QIcon(":/res/right.png")); } @@ -292,9 +291,9 @@ void GDDCdlg::resizeUI() /******控制区位置和大小设置*****/ double cmdAreaHeight; double cmdAreaWidth; - if(m_GDDCStateDlg->isVisible()){cmdAreaWidth = GDDCPageWidth-STATEPAGEWIDTH;} + if(isStatePageShow){cmdAreaWidth = GDDCPageWidth-STATEPAGEWIDTH;} else{cmdAreaWidth = GDDCPageWidth;} - if(m_GDDCCmdDlg->isVisible()){cmdAreaHeight = CMDPAGEHIGHT;} + if(isCmdPageShow){cmdAreaHeight = CMDPAGEHIGHT;} else{cmdAreaHeight = 0;} m_GDDCCmdDlg->setGeometry(0,GDDCPageHeight-cmdAreaHeight,(int)cmdAreaWidth,(int)cmdAreaHeight); m_GDDCCmdDlg->ui->tabWidget->setGeometry(0,0,(int)cmdAreaWidth,(int)cmdAreaHeight); @@ -303,7 +302,7 @@ void GDDCdlg::resizeUI() /*********状态区位置和大小设置***********/ double stateAreaHeight = GDDCPageHeight; double stateAreaWidth; - if(m_GDDCStateDlg->isVisible()){stateAreaWidth = STATEPAGEWIDTH;} + if(isStatePageShow){stateAreaWidth = STATEPAGEWIDTH;} else{stateAreaWidth = 0;} m_GDDCStateDlg->setGeometry(GDDCPageWidth-stateAreaWidth,0,stateAreaWidth,stateAreaHeight); m_GDDCStateDlg->ui->tableViewShowIState->setGeometry(0,0,stateAreaWidth,stateAreaHeight); diff --git a/Src/HomePage/homepagedlg.cpp b/Src/HomePage/homepagedlg.cpp index 9c0a15b..1fad009 100644 --- a/Src/HomePage/homepagedlg.cpp +++ b/Src/HomePage/homepagedlg.cpp @@ -70,7 +70,7 @@ void HomePageDlg::initButton() { QIcon icon; icon.addFile(":/res/settings.png"); - QPushButton* btn = new QPushButton; + btn = new QPushButton; btn->setParent(this); btn->setMinimumSize(40,40); btn->setMaximumSize(40,40); @@ -91,4 +91,11 @@ void HomePageDlg::on_pushButton_clicked() { emit sendUrl(_urlMap); } +//区域重绘 +void HomePageDlg::resizeEvent(QResizeEvent *event) +{ + double GDDCPageHeight = (double)(this->height()); + double GDDCPageWidth = (double)(this->width()); + btn->setGeometry(GDDCPageWidth-40,0,40,40); +} diff --git a/Src/HomePage/homepagedlg.h b/Src/HomePage/homepagedlg.h index 4e3ec79..a88cb1a 100644 --- a/Src/HomePage/homepagedlg.h +++ b/Src/HomePage/homepagedlg.h @@ -4,7 +4,7 @@ #include #include #include "Src/HomePage/homepagesetingwidget.h" - +#include "QPushButton" namespace Ui { class HomePageDlg; } @@ -29,6 +29,10 @@ private: QString _adHocNetwork; QString _satelliteComm; std::unordered_map _urlMap; + QPushButton* btn; +protected: + void resizeEvent(QResizeEvent *event); + signals: void sendUrl(std::unordered_map urlMap); private slots: diff --git a/Src/HomePage/homepagedlg.ui b/Src/HomePage/homepagedlg.ui index 06b1a9d..85aa9bf 100644 --- a/Src/HomePage/homepagedlg.ui +++ b/Src/HomePage/homepagedlg.ui @@ -20,21 +20,7 @@ Form - - - - GroupBox - - - - - - - GroupBox - - - - + @@ -55,28 +41,11 @@ - - - - - - - GroupBox - - - - - - - GroupBox - - - diff --git a/Src/HomePage/homepagesetingwidget.ui b/Src/HomePage/homepagesetingwidget.ui index a678061..97193f1 100644 --- a/Src/HomePage/homepagesetingwidget.ui +++ b/Src/HomePage/homepagesetingwidget.ui @@ -7,7 +7,7 @@ 0 0 725 - 443 + 404 @@ -17,247 +17,279 @@ :/res/settings.png:/res/settings.png - - - - 30 - 10 - 661 - 181 - - - - QFrame::Shape::StyledPanel - - - QFrame::Shadow::Raised - - - - - - QFrame::Shape::StyledPanel - - - QFrame::Shadow::Raised - - - - - - L链 - - - - - - IP: - - - - - - - - - - - - Qt::Orientation::Horizontal - - - QSizePolicy::Policy::Fixed - - - - 60 - 20 - - - - - - - - - 100 - 16777215 - - + + + + + QFrame::Shape::StyledPanel + + + QFrame::Shadow::Raised + + + + + + QFrame::Shape::StyledPanel + + + QFrame::Shadow::Raised + + + + + + 卫通 + + + + - 设置 + IP: + + + + + + + + + Qt::Orientation::Horizontal + + + QSizePolicy::Policy::Fixed + + + + 20 + 20 + + + + + + + + + 100 + 0 + + + + + 100 + 0 + + + + + 200 + 16777215 + + + + 设置 + + + + + - - - - - - - - 宽带自组网 - - - - - - - - Qt::Orientation::Horizontal - - - QSizePolicy::Policy::Fixed - - - - 60 - 20 - - - + + + + + + 宽带自组网 + + + + - - - - - 100 - 16777215 - - + + - 设置 + IP: - - - - - - IP: - - - - - - - - - - - - - 卫通 - - - - - - IP: - - - - - - - - - - - - Qt::Orientation::Horizontal - - - QSizePolicy::Policy::Fixed - - - - 60 - 20 - - - + + + + + + Qt::Orientation::Horizontal + + + QSizePolicy::Policy::Fixed + + + + 20 + 20 + + + + + + + + + 100 + 0 + + + + + 100 + 0 + + + + + 200 + 16777215 + + + + 设置 + + + + - - - - - 100 - 16777215 - - + + + + + + + L链 + + + + - 设置 + IP: + + + + + + + + + Qt::Orientation::Horizontal + + + QSizePolicy::Policy::Fixed + + + + 20 + 20 + + + + + + + + + 100 + 0 + + + + + 100 + 0 + + + + + 200 + 16777215 + + + + 设置 + + + + + - - - - - - - - - - - - - Qt::Orientation::Horizontal - - - QSizePolicy::Policy::Fixed - - - - 450 - 20 - - - - - - - - - 0 - 0 - - - - - 160 - 30 - - - - 一键设置 - + + + - - - Qt::Orientation::Horizontal - - - QSizePolicy::Policy::Fixed - - - - 15 - 20 - - - + + + + + Qt::Orientation::Horizontal + + + QSizePolicy::Policy::Fixed + + + + 450 + 20 + + + + + + + + + 0 + 0 + + + + + 160 + 30 + + + + 一键设置 + + + + + + + Qt::Orientation::Horizontal + + + QSizePolicy::Policy::Fixed + + + + 15 + 20 + + + + + - - - + + + diff --git a/mainwindow.cpp b/mainwindow.cpp index 2b65f6f..3475b3d 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -83,7 +83,6 @@ void MainWindow::initWindow() m_SDFPDlg = new SDFPDlg(this); m_GDDCdlg = new GDDCdlg(this); m_HomePagedlg = new HomePageDlg(this); - m_ModelCameraDlg = new ModelCameraDlg(this); m_rescueLoadWidget = new RescueLoadWidget(this); diff --git a/mainwindow.ui b/mainwindow.ui index 1b90dd1..d612afb 100644 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -6,8 +6,8 @@ 0 0 - 1113 - 572 + 829 + 497 @@ -257,7 +257,7 @@ - + :/res/GDDC.png:/res/GDDC.png @@ -269,7 +269,7 @@ - + :/res/LChain.png:/res/LChain.png @@ -343,6 +343,8 @@ - + + +