From 6f9824fd16eac16a88808f70deed9d77a6cb67ad Mon Sep 17 00:00:00 2001 From: chengyang Date: Thu, 25 Feb 2021 15:01:46 +0800 Subject: [PATCH] =?UTF-8?q?ui=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/images.qrc | 2 + resources/images/control.png | Bin 0 -> 424 bytes resources/images/status.png | Bin 0 -> 828 bytes src/main_window.cpp | 13 +- ui/main_window.ui | 1603 ++++++++++++++++++---------------- 5 files changed, 839 insertions(+), 779 deletions(-) create mode 100644 resources/images/control.png create mode 100644 resources/images/status.png diff --git a/resources/images.qrc b/resources/images.qrc index 44973d2..e9f9b7e 100644 --- a/resources/images.qrc +++ b/resources/images.qrc @@ -140,5 +140,7 @@ images/toolbar_other.png images/toolbar_settings.png images/get_pos.png + images/control.png + images/status.png diff --git a/resources/images/control.png b/resources/images/control.png new file mode 100644 index 0000000000000000000000000000000000000000..722073c8fb22bf7dee6f1ad8a179ad22d234f489 GIT binary patch literal 424 zcmV;Z0ayNsP)xXw!UpjMWP`FnMhF|g2J{DK;TZENldA1WCxLz3``Fm# zfM0G2aQO+*3g{iLr0-PI9%0vSXNi{!qBX1^_@=5J^aY`wBo06cU@s zy$%UrMzzP=kN|tdjsG2hBd?$d37`)E=#T)4{j;D#0>HSvws;m=+=f`2iPOZ5DTbrg z2I-_toh@!#Z2{Ep6#m};G2?so0Vs(HViAxs6c`UntXKdjthR?dn@Xn${PS={n z0#UPV;ki|nvO6QEvj?8Qha0%ll;n7N@=q3K;R!O{0$;!t_!LhWeo8KKZQ8FA+b-lQ z=7@8S6(3u@6OBcSgs=%H+(^z{=K+k{Nb|bt*SwZza!&d}#tesw?ZJ-Vx7s)BgFgKL S9p2Ia000000096Nkl}=#Wu-^a|H!FJ%E)bec$cu+Kw{}*z{{a;)+Wga4GEa5(hxy z3O49|-s7hKe`lOxqs@lYUq%xTd=v|NXuC`cwE}d@mDs)0Fgry89SZpEt3} zq{^)E1h4-qnf;lRUqt-L6z*- z55<>tU8_30-}=j?uzZVb0(5zr7HS{HV>@qbGVi)$U;X%Uk-hh%lfpzOAiPhG5su?{ zy6b{bS74Nd&c}3KuWi97%a3={vFlC@)oZ6?tuU`1VTBV0WpFb!PfvGUW}<$g%5^7S ztoV5}&nOEAJ88i!is$TYTc$69Vx9Rqx{ge)kWm))wo_|b;kZgA50K>fi3Ou9)900i zpqP%rF`$Bl3DCjL_&lR>ws9#eyE%)YOw?ZxO5K+hDp3F~PfMZL&6(vvv((5 zYgI1=Dq1*ArR+nTpCl@!P|?r1pg>2hsf9{b;Q~2$Rw#CJ7TfXpXi*>wM%m}J?>SOO zW-h3iEPNu+X#1H9%5mZim+2^ETJ=CjhG}*C1ds=&qo3R)I0A%yPX5L`a8C{1#44BKYtme$A39!8cZ)xr zSCt^eZ6b&l)ZK|km}LPGno@@tVTDOQ1QM-fCL_$fZ~p+dQ|~+aioufr0000setIcon(QIcon("://images/close.png")); ui.btn_dash->setIcon(QIcon("://images/toolbar_dash.png")); ui.btn_map->setIcon(QIcon("://images/toolbar_map.png")); + ui.btn_control->setIcon(QIcon("://images/control.png")); + ui.btn_status->setIcon(QIcon("://images/status.png")); ui.btn_other->setIcon(QIcon("://images/toolbar_other.png")); rock_widget =new JoyStick(ui.JoyStick_widget); rock_widget->show(); @@ -139,6 +141,12 @@ void MainWindow::connections() QObject::connect(ui.btn_dash, &QPushButton::clicked, [=](){ ui.stackedWidget_main->setCurrentIndex(0); }); + QObject::connect(ui.btn_control,&QPushButton::clicked,[=](){ + ui.stackedWidget_left->setCurrentIndex(1); + }); + QObject::connect(ui.btn_status,&QPushButton::clicked,[=](){ + ui.stackedWidget_left->setCurrentIndex(0); + }); QObject::connect(ui.btn_map, &QPushButton::clicked, [=](){ ui.stackedWidget_main->setCurrentIndex(1); }); @@ -182,8 +190,6 @@ void MainWindow::connections() connect(ui.close_btn,SIGNAL(clicked()),this,SLOT(slot_closeWindows())); connect(ui.min_btn,SIGNAL(clicked()),this,SLOT(slot_minWindows())); connect(ui.max_btn,SIGNAL(clicked()),this,SLOT(slot_maxWindows())); - //hide - QObject::connect(ui.table_hide_btn,SIGNAL(clicked()),this,SLOT(slot_hide_table_widget())); connect(rock_widget,SIGNAL(keyNumchanged(int)),this,SLOT(slot_rockKeyChange(int))); connect(&qnode,SIGNAL(updateMap(QImage)),m_roboMap,SLOT(paintMaps(QImage))); connect(&qnode,SIGNAL(plannerPath(QPolygonF)),m_roboMap,SLOT(paintPlannerPath(QPolygonF))); @@ -204,11 +210,10 @@ void MainWindow::slot_updateCursorPos(QPointF pos){ void MainWindow::slot_hide_table_widget(){ if(ui.stackedWidget_left->isHidden()){ ui.stackedWidget_left->show(); - ui.table_hide_btn->setStyleSheet("QPushButton{background-image: url(://images/hide.png);border:none;}"); } else{ ui.stackedWidget_left->hide(); - ui.table_hide_btn->setStyleSheet("QPushButton{background-image: url(://images/show.png);border:none;}"); + //ui.table_hide_btn->setStyleSheet("QPushButton{background-image: url(://images/show.png);border:none;}"); } } void MainWindow::initOthers(){ diff --git a/ui/main_window.ui b/ui/main_window.ui index 355e354..9018f6f 100644 --- a/ui/main_window.ui +++ b/ui/main_window.ui @@ -19,7 +19,8 @@ background-color:rgb(255, 255, 255); -padding:0 +padding:0; + @@ -28,7 +29,7 @@ padding:0 margin:0 - + 0 @@ -45,295 +46,27 @@ padding:0 0 - - - 0 - - - - - - - - - 0 - - - 0 - - - 3 - - - 0 - - - 0 - - - - - - - - 32 - 32 - - - - - 32 - 32 - - - - - - - :/images/robot2.png - - - - - - - - - - 机器人状态: - - - - - - - - - - <html><head/><body><p><span style=" color:#cc0000;">离线</span></p></body></html> - - - - - - - - 32 - 32 - - - - - 32 - 32 - - - - - - - :/images/offline.png - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 电池电量 - - - - - - - - 30 - 30 - - - - - - - :/images/power.png - - - - - - - - 90 - 16777215 - - - - QProgressBar { - border: 2px solid grey; - border-radius: 5px; - text-align: center; -} - - - 0 - - - - - - - - 32 - 32 - - - - - 32 - 32 - - - - - - - :/images/power-v.png - - - - - - - - 50 - 32 - - - - - 50 - 32 - - - - - - - 00.00V - - - - - - - PointingHandCursor - - - border:none - - - - - - - .. - - - - - - - PointingHandCursor - - - border:none - - - - - - - .. - - - - - - - PointingHandCursor - - - border:none - - - - - - - .. - - - - - - - - - QFrame::HLine - - - QFrame::Raised - - - - - 330 - 10 - 120 - 80 - - - - - - - - + - 300 + 400 0 - 400 + 600 16777215 QStackedWidget{ -border-right:1px solid rgb(186, 189, 182); +border-right: 10px solid qlineargradient(x0:0, x1:1,stop: 0 white, stop: 1 #ececef); +background-color: transparent; } @@ -751,375 +484,506 @@ QPushButton:pressed{border-image: url(://images/down_right_2.png);} - - - - - 32 - 32 - - - - - 32 - 32 - - - - PointingHandCursor - - - background-image: url(://images/hide.png); -border:none; - - - - - - - - - - 1 - - - - - + + + + + + + + + 0 + + + 0 + + + 3 + + + 0 + + + 0 + + + + + + + + 32 + 32 + + + + + 32 + 32 + + + + + + + :/images/robot2.png + + + + + + + + + + 机器人状态: + + + + + + + + + + <html><head/><body><p><span style=" color:#cc0000;">离线</span></p></body></html> + + + + + + + + 32 + 32 + + + + + 32 + 32 + + + + + + + :/images/offline.png + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + 电池电量 + + + + + + + + 30 + 30 + + + + + + + :/images/power.png + + + + + + + + 90 + 16777215 + + + + QProgressBar { + border: 2px solid grey; + border-radius: 5px; + text-align: center; +} + + + 0 + + + + + + + + 32 + 32 + + + + + 32 + 32 + + + + + + + :/images/power-v.png + + + + + + + + 50 + 32 + + + + + 50 + 32 + + + + + + + 00.00V + + + + + + + PointingHandCursor + + + border:none + + + + + + + .. + + + + + + + PointingHandCursor + + + border:none + + + + + + + .. + + + + + + + PointingHandCursor + + + border:none + + + + + + + .. + + + + + + + + + + + + 0 + + + - + - - - - 200 - 200 - - - - - - - - - - - - 400 - 400 - - - - - - - - - - - - 200 - 200 - - - - Qt::RightToLeft - - - - - - - - - - - - Qt::NoContextMenu - - - QFrame::HLine - - - QFrame::Raised - - - - - - - - - + + + 200 200 - - - 200 - 200 - - - - border:1px solid rgb(0, 0, 0) - - No Video + - - + + - 200 - 200 - - - - - 200 - 200 + 250 + 250 - border:1px solid rgb(0, 0, 0) - - - No Video + - - + + - 400 + 200 200 - - border:1px solid rgb(0, 0, 0) + + Qt::RightToLeft + + + + + + + Qt::NoContextMenu + + + QFrame::HLine + + + QFrame::Raised + + + + + + + + + + + + 200 + 200 + + + + + 200 + 200 + + + + QLabel{ +border-top: 5px solid qlineargradient(y0:0, y1:1,stop: 0 #ececef, stop: 1 white); +border-left: 5px solid qlineargradient(x0:0, x1:1,stop: 0 #ececef, stop: 1 white); + border-bottom: 5px solid qlineargradient(y0:0, y1:1,stop: 0 white, stop: 1 #ececef); +border-right: 5px solid qlineargradient(x0:0, x1:1,stop: 0 white, stop: 1 #ececef); +background-color: rgb(255,255,255); +} + + + + No Video + + + + + + + + 200 + 200 + + + + + 200 + 200 + + + + QLabel{ +border-top: 5px solid qlineargradient(y0:0, y1:1,stop: 0 #ececef, stop: 1 white); +border-left: 5px solid qlineargradient(x0:0, x1:1,stop: 0 #ececef, stop: 1 white); + border-bottom: 5px solid qlineargradient(y0:0, y1:1,stop: 0 white, stop: 1 #ececef); +border-right: 5px solid qlineargradient(x0:0, x1:1,stop: 0 white, stop: 1 #ececef); +background-color: rgb(255,255,255); +} + + + + No Video + + + + + + + + 400 + 200 + + + + QWidget{ +border-top: 5px solid qlineargradient(y0:0, y1:1,stop: 0 #ececef, stop: 1 white); +border-left: 5px solid qlineargradient(x0:0, x1:1,stop: 0 #ececef, stop: 1 white); + border-bottom: 5px solid qlineargradient(y0:0, y1:1,stop: 0 white, stop: 1 #ececef); +border-right: 5px solid qlineargradient(x0:0, x1:1,stop: 0 white, stop: 1 #ececef); +background-color: rgb(255,255,255); +} + + + + + + + + - - - - - - - + + + - + - - - Move Camera - - - - :/images/rotate_cam.svg:/images/rotate_cam.svg - - - - - - - Select - - - - :/images/classes/Select.png:/images/classes/Select.png - - - - - - - - 16777215 - 16777215 - - - - 2D Pose Estimate - - - - :/images/classes/SetInitialPose.png:/images/classes/SetInitialPose.png - - - - - - - 2D Nav Goal - - - - :/images/classes/SetGoal.png:/images/classes/SetGoal.png - - - - - - - - 16777215 - 25 - - - - 设置返航点 - - - - :/images/set_return.png:/images/set_return.png - - - - - - - - 16777215 - 25 - - - - 返航 - - - - :/images/return.png:/images/return.png - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - Qt::LeftToRight - - - - - - Qt::ScrollBarAlwaysOff - - - Qt::ScrollBarAlwaysOff - - - - - + - - - - 40 - 0 - - - - - 40 - 16777215 - - + - map: + Move Camera + + + + :/images/rotate_cam.svg:/images/rotate_cam.svg - - - - 200 - 0 - - - - - 200 - 16777215 - - + - + Select + + + + :/images/classes/Select.png:/images/classes/Select.png - - - - 40 - 0 - - + - 40 + 16777215 16777215 - scene: + 2D Pose Estimate + + + + :/images/classes/SetInitialPose.png:/images/classes/SetInitialPose.png - - - - 200 - 0 - + + + 2D Nav Goal + + + :/images/classes/SetGoal.png:/images/classes/SetGoal.png + + + + + - 200 - 16777215 + 16777215 + 25 - + 设置返航点 + + + + :/images/set_return.png:/images/set_return.png - + + + + 16777215 + 25 + + + + 返航 + + + + :/images/return.png:/images/return.png + + + + + Qt::Horizontal @@ -1133,176 +997,104 @@ border:none; - - - - - - - - - - - - - + - - - - - - - - - - 200 - 195 - - - - - 200 - 200 - + + + Qt::LeftToRight - border:1px solid rgb(0, 0, 0) + - - No Video + + Qt::ScrollBarAlwaysOff + + + Qt::ScrollBarAlwaysOff - - - - 90 - 30 - - - - Video2 - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - - - 200 - 200 - - - - - 200 - 200 - - - - border:1px solid rgb(0, 0, 0) - - - No Video - - - - - - - - 16777215 - 15 - - - - Video3 - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - + - - - - 90 - 30 - - - - 话题列表: - - - - - + - 90 - 25 + 40 + 0 - 90 - 25 + 40 + 16777215 - - ArrowCursor - - - - - 刷新 - - - - :/images/refreash.png:/images/refreash.png + map: - + + + + 200 + 0 + + + + + 200 + 16777215 + + + + + + + + + + + + 40 + 0 + + + + + 40 + 16777215 + + + + scene: + + + + + + + + 200 + 0 + + + + + 200 + 16777215 + + + + + + + + + Qt::Horizontal @@ -1316,62 +1108,247 @@ border:none; - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - + + + + - - - - 16777215 - 16777215 - - - - Info - - - - - - - 300 - 0 - - - - - 12312312 - 12312312 - - - - - - + + + + + + + + + + + + + + + + 200 + 195 + + + + + 200 + 200 + + + + border:1px solid rgb(0, 0, 0) + + + No Video + + + + + + + + 90 + 30 + + + + Video2 + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + + 200 + 200 + + + + + 200 + 200 + + + + border:1px solid rgb(0, 0, 0) + + + No Video + + + + + + + + 16777215 + 15 + + + + Video3 + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + + + + 90 + 30 + + + + 话题列表: + + + + + + + + 90 + 25 + + + + + 90 + 25 + + + + ArrowCursor + + + + + + 刷新 + + + + :/images/refreash.png:/images/refreash.png + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + + 16777215 + 16777215 + + + + Info + + + + + + + 300 + 0 + + + + + 12312312 + 12312312 + + + + + + + + - - - - + + + + @@ -1406,11 +1383,87 @@ background-color:rgb(67, 154, 246); 0 + + + + + 0 + 60 + + + + QPushButton:hover{ +background-color:rgb(114, 159, 207); +border-bottom:2px solid rgb(204, 0, 0) +} +QPushButton:checked{ +background-color:cyan; +border-bottom:2px solid white +} +QPushButton:pressed{ +background-color:green +} +QPushButton{ +background-color:rgb(67, 154, 246); +border:none; +padding:0px 0px 0px 0px; +margin:0px 0px 0px 0px; +} + + + + + + + 32 + 32 + + + + + + + + + 0 + 60 + + + + QPushButton:hover{ +background-color:rgb(114, 159, 207); +border-bottom:2px solid rgb(204, 0, 0) +} +QPushButton:checked{ +background-color:cyan; +border-bottom:2px solid white +} +QPushButton:pressed{ +background-color:green +} +QPushButton{ +background-color:rgb(67, 154, 246); +border:none; +padding:0px 0px 0px 0px; +margin:0px 0px 0px 0px; +} + + + + + + + 32 + 32 + + + + - 64 + 0 60 @@ -1455,7 +1508,7 @@ margin:0px 0px 0px 0px; - 64 + 0 60 @@ -1500,7 +1553,7 @@ margin:0px 0px 0px 0px; - 64 + 0 60 @@ -1543,7 +1596,7 @@ border:none; - 64 + 0 60