diff --git a/MainWindow.h b/MainWindow.h index 9682185..b57fe37 100644 --- a/MainWindow.h +++ b/MainWindow.h @@ -138,10 +138,7 @@ public: setButtonMes(); // 设置按钮点击跳转窗口 - connect(monitorButton, &QPushButton::clicked, this, [=](){this->stackedWidget->setCurrentIndex(0); }); - connect(flangeButton, &QPushButton::clicked, this, [=](){this->stackedWidget->setCurrentIndex(1); }); - connect(clearanceButton, &QPushButton::clicked, this, [=](){this->stackedWidget->setCurrentIndex(2); }); - connect(gyroscopeButton, &QPushButton::clicked, this, [=](){this->stackedWidget->setCurrentIndex(3); }); + connect(closeButton, &QPushButton::clicked, MainWindow, &QMainWindow::close); @@ -154,14 +151,40 @@ public: void setButtonMes() { - minButton->setText(QString()); - closeButton->setText(QString()); monitorButton->setText(u8"监 控 总 览"); flangeButton->setText(u8"法 兰 分 析"); clearanceButton->setText(u8"净 空 分 析"); gyroscopeButton->setText(u8"陀 螺 仪 监 测"); + + connect(monitorButton, &QPushButton::clicked, this, [=](){this->stackedWidget->setCurrentIndex(0); }); + connect(flangeButton, &QPushButton::clicked, this, [=](){this->stackedWidget->setCurrentIndex(1); }); + connect(clearanceButton, &QPushButton::clicked, this, [=](){this->stackedWidget->setCurrentIndex(2); }); + connect(gyroscopeButton, &QPushButton::clicked, this, [=](){this->stackedWidget->setCurrentIndex(3); }); + + connect(monitorButton, &QPushButton::clicked, this, [=](){this->clearButton();}); + connect(flangeButton, &QPushButton::clicked, this, [=](){this->clearButton();}); + connect(clearanceButton, &QPushButton::clicked, this, [=](){this->clearButton();}); + connect(gyroscopeButton, &QPushButton::clicked, this, [=](){this->clearButton();}); + connect(monitorButton, &QPushButton::clicked, this, [=](){monitorButton->setChecked(true);}); + connect(flangeButton, &QPushButton::clicked, this, [=](){flangeButton->setChecked(true);}); + connect(clearanceButton, &QPushButton::clicked, this, [=](){clearanceButton->setChecked(true);}); + connect(gyroscopeButton, &QPushButton::clicked, this, [=](){gyroscopeButton->setChecked(true);}); + + monitorButton->setCheckable(true); + flangeButton->setCheckable(true); + clearanceButton->setCheckable(true); + gyroscopeButton->setCheckable(true); + + monitorButton->setChecked(true); } // retranslateUi + void clearButton(){ + monitorButton->setChecked(false); + flangeButton->setChecked(false); + clearanceButton->setChecked(false); + gyroscopeButton->setChecked(false); + } + MainWindow(){ this->setupUi(this); } diff --git a/MonitorUI/MonitorTagUI.h b/MonitorUI/MonitorTagUI.h index b1e8363..af8b0eb 100644 --- a/MonitorUI/MonitorTagUI.h +++ b/MonitorUI/MonitorTagUI.h @@ -72,9 +72,7 @@ public: verticalLayout->setObjectName(QString::fromUtf8("verticalLayout")); stateBox = new QComboBox(MonitorTag); - stateBox->setEditable(true); - stateBox->lineEdit()->setAlignment(Qt::AlignCenter); - QStringList options = {"杩滅▼妯″紡", "寰呮満绛夐", "鍋滄満缁存姢", "鍚姩"}; + QStringList options = {" 杩滅▼妯″紡", " 寰呮満绛夐", " 鍋滄満缁存姢", " 鍚姩"}; stateBox->addItems(options); diff --git a/Static/DamQSS.Qss b/Static/DamQSS.Qss index 6f285cd..2fd49ee 100644 --- a/Static/DamQSS.Qss +++ b/Static/DamQSS.Qss @@ -35,6 +35,13 @@ QLabel{ color: #DDDDE9; font-family: Microsoft YaHei; font-weight: bold; + font-size: 18px; + +} + +QLabel#nameLabel{ + + font-size: 20px; } @@ -78,6 +85,20 @@ QPushButton#monitorButton, QPushButton#flangeButton, QPushButton#clearanceButton } +QPushButton#monitorButton:checked, QPushButton#flangeButton:checked, QPushButton#clearanceButton:checked, QPushButton#gyroscopeButton:checked{ + + color: white; + background-color: rgba(16,68,105, 80%);; + border-radius: 5px; + border: 3px solid; + border-color: #ffffff; + height: 30px; + font-family: Microsoft YaHei; + font-weight: bold; + font-size: 20px; + +} + QPushButton#normalButton, QPushButton#standbyButton, QPushButton#hutdownButton, QPushButton#failureButton, QPushButton#runButton, QPushButton#interruptedButton{ background-color: rgba(16,68,105, 80%); @@ -91,6 +112,25 @@ QPushButton#normalButton, QPushButton#standbyButton, QPushButton#hutdownButton, } + + +QPushButton#normalButton:hover, QPushButton#standbyButton:hover, QPushButton#hutdownButton:hover, QPushButton#failureButton:hover, QPushButton#runButton:hover, QPushButton#interruptedButton:hover{ + + color: #2277EF; + background-color: #F7F7F7; + solid #2277EF; + +} + + +QPushButton#normalButton:checked, QPushButton#standbyButton:checked, QPushButton#hutdownButton:checked, QPushButton#failureButton:checked, QPushButton#runButton:checked, QPushButton#interruptedButton:checked{ + + background-color: #F5F5F6; + color: #2277EF; + solid #2277EF; + +} + QListView#deviceList, QListView#flangeList{ border: 3px solid; diff --git a/Static/down.png b/Static/down.png index f0e4f6b..f9cbf60 100644 Binary files a/Static/down.png and b/Static/down.png differ