This commit is contained in:
2020-09-08 16:56:59 +08:00
parent 71012d1ad5
commit 93c56f4347
91 changed files with 199 additions and 79 deletions

Before

Width:  |  Height:  |  Size: 63 KiB

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

Before

Width:  |  Height:  |  Size: 71 KiB

After

Width:  |  Height:  |  Size: 71 KiB

+69 -7
View File
@@ -56,17 +56,19 @@ MenuBarUI::MenuBarUI(QWidget *parent) :
this,SLOT(MessageTimeOut()));
//ui->pushButton_Setting->setText();
/*
QPixmap pixmap(":/img/Mission.png");
ui->label_Status->setPixmap(pixmap);
ui->label_Status->setMask(pixmap.mask());
*/
showMessage(tr("Starting...\n"),5000);
setPushButtonState(state::unSelected,
state::unSelected,
state::unSelected,
state::Selected,
state::unSelected);
}
MenuBarUI::~MenuBarUI()
@@ -83,6 +85,34 @@ MenuBarUI::~MenuBarUI()
delete ui;
}
void MenuBarUI::setPushButtonState(uint8_t state1,uint8_t state2,uint8_t state3,uint8_t state4,uint8_t state5)
{
ui->pushButton_Setting->setProperty("state",state1);
ui->pushButton_Setting->style()->unpolish(ui->pushButton_Setting);
ui->pushButton_Setting->style()->polish(ui->pushButton_Setting);
ui->pushButton_SelfTest->setProperty("state",state2);
ui->pushButton_SelfTest->style()->unpolish(ui->pushButton_SelfTest);
ui->pushButton_SelfTest->style()->polish(ui->pushButton_SelfTest);
ui->pushButton_Mission->setProperty("state",state3);
ui->pushButton_Mission->style()->unpolish(ui->pushButton_Mission);
ui->pushButton_Mission->style()->polish(ui->pushButton_Mission);
ui->pushButton_Flight->setProperty("state",state4);
ui->pushButton_Flight->style()->unpolish(ui->pushButton_Flight);
ui->pushButton_Flight->style()->polish(ui->pushButton_Flight);
ui->pushButton_Info->setProperty("state",state5);
ui->pushButton_Info->style()->unpolish(ui->pushButton_Info);
ui->pushButton_Info->style()->polish(ui->pushButton_Info);
}
void MenuBarUI::onClicked()
{
@@ -91,26 +121,58 @@ void MenuBarUI::onClicked()
void MenuBarUI::on_pushButton_Setting_clicked()
{
setPushButtonState(state::Selected,
state::unSelected,
state::unSelected,
state::unSelected,
state::unSelected);
update();
emit IndexChanged(0);
}
void MenuBarUI::on_pushButton_SelfTest_clicked()
{
setPushButtonState(state::unSelected,
state::Selected,
state::unSelected,
state::unSelected,
state::unSelected);
update();
emit IndexChanged(1);
}
void MenuBarUI::on_pushButton_Mission_clicked()
{
setPushButtonState(state::unSelected,
state::unSelected,
state::Selected,
state::unSelected,
state::unSelected);
update();
emit IndexChanged(2);
}
void MenuBarUI::on_pushButton_Flight_clicked()
{
setPushButtonState(state::unSelected,
state::unSelected,
state::unSelected,
state::Selected,
state::unSelected);
update();
emit IndexChanged(3);
}
void MenuBarUI::on_pushButton_Info_clicked()
{
setPushButtonState(state::unSelected,
state::unSelected,
state::unSelected,
state::unSelected,
state::Selected);
update();
emit IndexChanged(4);
}
+14
View File
@@ -11,6 +11,9 @@
#include "QTimer"
#include <QCommonStyle>
#include "QStyle"
namespace Ui {
class MenuBarUI;
}
@@ -20,6 +23,14 @@ class MenuBarUI : public QWidget
Q_OBJECT
public:
enum state{
unSelected = 0,
preSelected = 1,
Selected = 2,
};
explicit MenuBarUI(QWidget *parent = nullptr);
~MenuBarUI();
@@ -35,6 +46,9 @@ signals:
void IndexChanged(int);
private slots:
void setPushButtonState(uint8_t state1,uint8_t state2,uint8_t state3,uint8_t state4,uint8_t state5);
void onClicked(void);
void MessageTimeOut(void);
+27 -26
View File
@@ -20,74 +20,75 @@ QLabel {
}
.QPushButton#pushButton_Setting{
border-image:url(:/img/Setting.png);
.QPushButton#pushButton_Setting[state="0"]{
border-image:url(:/img/Setting_unSelected.png);
}
.QPushButton#pushButton_Setting:hover{
border-image:url(:/img/SettingClicked.png);
border-image:url(:/img/Setting_preSelected.png);
}
.QPushButton#pushButton_Setting:pressed{
border-image:url(:/img/SettingClicked.png);
.QPushButton#pushButton_Setting[state="2"]{
border-image:url(:/img/Setting_Selected.png);
}
.QPushButton#pushButton_SelfTest{
border-image:url(:/img/SelfCheck.png);
.QPushButton#pushButton_SelfTest[state="0"]{
border-image:url(:/img/SelfTest_unSelected.png);
}
.QPushButton#pushButton_SelfTest:hover{
border-image:url(:/img/SelfCheckClicked.png);
border-image:url(:/img/SelfTest_preSelected.png);
}
.QPushButton#pushButton_SelfTest:pressed{
border-image:url(:/img/SelfCheckClicked.png);
.QPushButton#pushButton_SelfTest[state="2"]{
border-image:url(:/img/SelfTest_Selected.png);
}
.QPushButton#pushButton_Mission{
border-image:url(:/img/Mission.png);
.QPushButton#pushButton_Mission[state="0"]{
border-image:url(:/img/Mission_unSelected.png);
}
.QPushButton#pushButton_Mission:hover{
border-image:url(:/img/Mission_Clicked.png);
border-image:url(:/img/Mission_preSelect.png);
}
.QPushButton#pushButton_Mission:pressed{
border-image:url(:/img/Mission_Clicked.png);
.QPushButton#pushButton_Mission[state="2"]{
border-image:url(:/img/Mission_Selected.png);
}
.QPushButton#pushButton_Flight{
border-image:url(:/img/Flight.png);
.QPushButton#pushButton_Flight[state="0"]{
border-image:url(:/img/Flight_unSelected.png);
}
.QPushButton#pushButton_Flight:hover{
border-image:url(:/img/FlightClicked.png);
border-image:url(:/img/Flight_preSelected.png);
}
.QPushButton#pushButton_Flight:pressed{
border-image:url(:/img/FlightClicked.png);
.QPushButton#pushButton_Flight[state="2"]{
border-image:url(:/img/Flight_Selected.png);
}
.QPushButton#pushButton_Info{
border-image:url(:/img/toolBox.png);
.QPushButton#pushButton_Info[state="0"]{
border-image:url(:/img/ToolBox_unSelected.png);
}
.QPushButton#pushButton_Info:hover{
border-image:url(:/img/toolBoxClicked.png);
border-image:url(:/img/ToolBox_preSelected.png);
}
.QPushButton#pushButton_Info:pressed{
border-image:url(:/img/toolBoxClicked.png);
.QPushButton#pushButton_Info[state="2"]{
border-image:url(:/img/ToolBox_Selected.png);
}
+15 -10
View File
@@ -3,15 +3,20 @@
<file>MenuBarUI.qss</file>
</qresource>
<qresource prefix="/img">
<file>Mission_Clicked.png</file>
<file>Setting.png</file>
<file>SettingClicked.png</file>
<file>SelfCheck.png</file>
<file>SelfCheckClicked.png</file>
<file>Flight.png</file>
<file>FlightClicked.png</file>
<file>toolBox.png</file>
<file>toolBoxClicked.png</file>
<file>Mission.png</file>
<file>Mission_preSelect.png</file>
<file>Mission_Selected.png</file>
<file>Mission_unSelected.png</file>
<file>SelfTest_preSelected.png</file>
<file>SelfTest_Selected.png</file>
<file>SelfTest_unSelected.png</file>
<file>Setting_preSelected.png</file>
<file>Setting_Selected.png</file>
<file>Setting_unSelected.png</file>
<file>ToolBox_preSelected.png</file>
<file>ToolBox_Selected.png</file>
<file>ToolBox_unSelected.png</file>
<file>Flight_preSelected.png</file>
<file>Flight_Selected.png</file>
<file>Flight_unSelected.png</file>
</qresource>
</RCC>

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 34 KiB

Before

Width:  |  Height:  |  Size: 98 KiB

After

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 KiB

Before

Width:  |  Height:  |  Size: 94 KiB

After

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 32 KiB

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Before

Width:  |  Height:  |  Size: 8.8 KiB

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

+19 -2
View File
@@ -20,12 +20,12 @@ Setting::Setting(QWidget *parent) :
index1 = new Index1(this);;
connect(this,SIGNAL(IndexChanged(int)),
this,SLOT(onTabIndexChanged(int)));
setPushButtonState(state::Selected,
state::unSelected);
CurrentIndex = 0;
emit IndexChanged(CurrentIndex);
@@ -58,6 +58,17 @@ void Setting::resizeEvent(QResizeEvent *event)
update();
}
void Setting::setPushButtonState(uint8_t state1,uint8_t state2)
{
ui->pushButton_software->setProperty("state",state1);
ui->pushButton_software->style()->unpolish(ui->pushButton_software);
ui->pushButton_software->style()->polish(ui->pushButton_software);
ui->pushButton_plane->setProperty("state",state2);
ui->pushButton_plane->style()->unpolish(ui->pushButton_plane);
ui->pushButton_plane->style()->polish(ui->pushButton_plane);
}
void Setting::onTabIndexChanged(const int &index)//界面选择管理
@@ -73,12 +84,18 @@ void Setting::onTabIndexChanged(const int &index)//界面选择管理
void Setting::on_pushButton_software_clicked()
{
setPushButtonState(state::Selected,
state::unSelected);
update();
CurrentIndex = 0;
emit IndexChanged(CurrentIndex);
}
void Setting::on_pushButton_plane_clicked()
{
setPushButtonState(state::unSelected,
state::Selected);
update();
CurrentIndex = 1;
emit IndexChanged(CurrentIndex);
}
+12 -3
View File
@@ -8,6 +8,10 @@
#include "Index0.h"
#include "Index1.h"
#include <QCommonStyle>
#include "QStyle"
namespace Ui {
class Setting;
}
@@ -17,6 +21,13 @@ class Setting : public QWidget
Q_OBJECT
public:
enum state{
unSelected = 0,
preSelected = 1,
Selected = 2,
};
explicit Setting(QWidget *parent = nullptr);
~Setting();
@@ -30,12 +41,10 @@ public:
private slots:
void setPushButtonState(uint8_t state1,uint8_t state2);
void onTabIndexChanged(const int &index);
private slots:
void on_pushButton_software_clicked();
+29 -25
View File
@@ -4,31 +4,6 @@
background-color: #FFFFFF;
}
.QPushButton {
background-color: #FFFFFF /*palegoldenrod*/;
border-width: 2px;
border-color: darkkhaki;
border-style: solid;
border-radius: 5;
padding: 3px;
font: 15px "Arial";
}
.QPushButton:pressed {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 #dadbde, stop: 1 #f6f7fa);
}
.QPushButton:flat {
border: none; /* no border for a flat push button */
}
.QPushButton:default {
border-color: navy; /* make the default button prominent */
}
.QLineEdit {
background-color: #FFFFFF;
font: 15px "Arial";
@@ -64,3 +39,32 @@
text-align: center;
color: rgb(255, 85, 0);
}
.QPushButton#pushButton_software[state="0"]{
border-image:url(:/img/SoftSetting_unSelected.png);
}
.QPushButton#pushButton_software:hover{
border-image:url(:/img/SoftSetting_preSelected.png);
}
.QPushButton#pushButton_software[state="2"]{
border-image:url(:/img/SoftSetting_Selected.png);
}
.QPushButton#pushButton_plane[state="0"]{
border-image:url(:/img/PlaneSetting_unSelected.png);
}
.QPushButton#pushButton_plane:hover{
border-image:url(:/img/PlaneSetting_preSelected.png);
}
.QPushButton#pushButton_plane[state="2"]{
border-image:url(:/img/PlaneSetting_Selected.png);
}
+6 -6
View File
@@ -42,18 +42,18 @@
<widget class="QPushButton" name="pushButton_software">
<property name="minimumSize">
<size>
<width>150</width>
<width>80</width>
<height>80</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>150</width>
<width>80</width>
<height>80</height>
</size>
</property>
<property name="text">
<string>software</string>
<string/>
</property>
</widget>
</item>
@@ -61,18 +61,18 @@
<widget class="QPushButton" name="pushButton_plane">
<property name="minimumSize">
<size>
<width>150</width>
<width>80</width>
<height>80</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>150</width>
<width>80</width>
<height>80</height>
</size>
</property>
<property name="text">
<string>plane</string>
<string/>
</property>
</widget>
</item>
+8
View File
@@ -2,4 +2,12 @@
<qresource prefix="/qss">
<file>Setting.qss</file>
</qresource>
<qresource prefix="/img">
<file>SoftSetting_preSelected.png</file>
<file>SoftSetting_Selected.png</file>
<file>SoftSetting_unSelected.png</file>
<file>PlaneSetting_preSelected.png</file>
<file>PlaneSetting_Selected.png</file>
<file>PlaneSetting_unSelected.png</file>
</qresource>
</RCC>
Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Before

Width:  |  Height:  |  Size: 8.8 KiB

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 98 KiB

After

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 KiB

Before

Width:  |  Height:  |  Size: 94 KiB

After

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 32 KiB

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 63 KiB

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

Before

Width:  |  Height:  |  Size: 71 KiB

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.
Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 769 KiB

Binary file not shown.
Binary file not shown.
Binary file not shown.