From 0b6093cf25e3a8e22fe342326b17f7f45e2aa406 Mon Sep 17 00:00:00 2001 From: zhangxuxutm <951937200@qq.com> Date: Wed, 7 Jun 2023 20:54:19 +0800 Subject: [PATCH] =?UTF-8?q?0607=E6=9B=B4=E6=96=B0c?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CMakeLists.txt | 2 +- DAM.qrc | 3 ++ MainWindow.h | 3 +- MonitorUI/MonitorUI.h | 36 +++++++------ Static/DamQSS.Qss | 120 +++++++++++++++++++++++++++++++++++++++--- Static/close.png | Bin 2248 -> 625 bytes Static/min.png | Bin 1059 -> 324 bytes 7 files changed, 139 insertions(+), 25 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d235a46..64e6ec3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,7 +10,7 @@ set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) #定义两个变量,表示头文件路径和库路径 -set(OPENSSL_ROOT_DIR "F:/OpenSSL-Win64") +set(OPENSSL_ROOT_DIR "D:/openssl/OpenSSL-Win64") set(OPENSSL_INCLUDE_DIR "${OPENSSL_ROOT_DIR}/include") set(OPENSSL_LIB_DIR "${OPENSSL_ROOT_DIR}/lib") find_package(OpenSSL REQUIRED) diff --git a/DAM.qrc b/DAM.qrc index cb19834..327b293 100644 --- a/DAM.qrc +++ b/DAM.qrc @@ -16,5 +16,8 @@ Static/headNormal.png Static/fanInterrupted.png Static/userPic.png + Static/windPic.png + Static/Sliding.png + Static/down.png diff --git a/MainWindow.h b/MainWindow.h index 79ec69d..b035d0e 100644 --- a/MainWindow.h +++ b/MainWindow.h @@ -56,7 +56,8 @@ public: titleWidget->setObjectName(QString::fromUtf8("titleWidget")); horizontalLayout = new QHBoxLayout(titleWidget); horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout")); - horizontalLayout->setContentsMargins(0, 0, 0, 0); + horizontalLayout->setContentsMargins(0, 0, 10, 20); + horizontalLayout->setSpacing(10); horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); horizontalLayout->addItem(horizontalSpacer); diff --git a/MonitorUI/MonitorUI.h b/MonitorUI/MonitorUI.h index c121219..570b408 100644 --- a/MonitorUI/MonitorUI.h +++ b/MonitorUI/MonitorUI.h @@ -27,7 +27,7 @@ class MonitorWidget:public QWidget public: QVBoxLayout *verticalLayout; QHBoxLayout *operationLayout; - QPushButton *exchangeButton; +// QPushButton *exchangeButton; QSpacerItem *horizontalSpacer; QGridLayout *monitorLayout; QHBoxLayout *filterlLayout; @@ -54,17 +54,17 @@ public: verticalLayout->setContentsMargins(0, 0, 0, 0); operationLayout = new QHBoxLayout(); operationLayout->setObjectName(QString::fromUtf8("operationLayout")); - exchangeButton = new QPushButton(MonitorWidget); - exchangeButton->setObjectName(QString::fromUtf8("exchangeButton")); +// exchangeButton = new QPushButton(MonitorWidget); +// exchangeButton->setObjectName(QString::fromUtf8("exchangeButton")); - operationLayout->addWidget(exchangeButton); +// operationLayout->addWidget(exchangeButton); horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); operationLayout->addItem(horizontalSpacer); - verticalLayout->addLayout(operationLayout); +// verticalLayout->addLayout(operationLayout); monitorLayout = new QGridLayout(); monitorLayout->setObjectName(QString::fromUtf8("monitorLayout")); @@ -79,7 +79,8 @@ public: monitorLayout->setColumnStretch(6, 1); fillWidget = new QWidget(); fillWidget->setLayout(monitorLayout); - connect(exchangeButton, &QPushButton::clicked, this, [=](){this->changeState();}); + fillWidget->setObjectName(QString::fromUtf8("fillWidget")); +// connect(exchangeButton, &QPushButton::clicked, this, [=](){this->changeState();}); QScrollArea *scrollArea = new QScrollArea(); @@ -88,6 +89,7 @@ public: scrollArea->setWidgetResizable(true); scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); scrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn); + scrollArea->setObjectName(QString::fromUtf8("scrollArea")); verticalLayout->addWidget(scrollArea); @@ -129,8 +131,8 @@ public: runButton->setIcon(QIcon(":/Static/fanRun.png")); filterlLayout->addWidget(runButton); - filterlLayout->setContentsMargins(10, 10, 10, 10); - filterlLayout->setSpacing(20); + filterlLayout->setContentsMargins(30, 10, 30, 30); + filterlLayout->setSpacing(50); verticalLayout->addLayout(filterlLayout); @@ -151,14 +153,14 @@ public: }); timer->start(5000); - connect(exchangeButton, &QPushButton::clicked, this, [=](){this->exchangeClicked();}); +// connect(exchangeButton, &QPushButton::clicked, this, [=](){this->exchangeClicked();}); } // setupUi void retranslateUi(QWidget *MonitorWidget) { MonitorWidget->setWindowTitle(QCoreApplication::translate("MonitorWidget", "Form", nullptr)); - exchangeButton->setText(QCoreApplication::translate("MonitorWidget", "\345\244\247\345\260\217\345\233\276\346\240\207\345\210\207\346\215\242", nullptr)); +// exchangeButton->setText(QCoreApplication::translate("MonitorWidget", "\345\244\247\345\260\217\345\233\276\346\240\207\345\210\207\346\215\242", nullptr)); } // retranslateUi void exchangeClicked() @@ -234,6 +236,8 @@ public: monitorLayout->setRowStretch(1, 1); monitorLayout->setRowStretch(2, 1); monitorLayout->setRowStretch(3, 1); + }else{ + fillWidget->setFixedHeight(228 * ceil(allFans.size() / 4)); } fillWidget->setFixedWidth(1900); setButtonMes(); @@ -243,12 +247,12 @@ public: } void setButtonMes(){ - interruptedButton->setText(QString("通讯中断") + QString::number(fans.interruptedFans.size())); - normalButton->setText(QString("正常运行") + QString::number(fans.normalFans.size())); - standbyButton->setText(QString("待机等风") + QString::number(fans.standbyFans.size())); - hutdownButton->setText(QString("停机维护") + QString::number(fans.hutdownFans.size())); - failureButton->setText(QString("故障停机") + QString::number(fans.interruptedFans.size())); - runButton->setText(QString("启动") + QString::number(fans.runFans.size())); + interruptedButton->setText(QString("通讯中断 ") + QString::number(fans.interruptedFans.size())); + normalButton->setText(QString("正常运行 ") + QString::number(fans.normalFans.size())); + standbyButton->setText(QString("待机等风 ") + QString::number(fans.standbyFans.size())); + hutdownButton->setText(QString("停机维护 ") + QString::number(fans.hutdownFans.size())); + failureButton->setText(QString("故障停机 ") + QString::number(fans.interruptedFans.size())); + runButton->setText(QString("启动 ") + QString::number(fans.runFans.size())); } MonitorWidget() diff --git a/Static/DamQSS.Qss b/Static/DamQSS.Qss index 0428ba8..80b7807 100644 --- a/Static/DamQSS.Qss +++ b/Static/DamQSS.Qss @@ -1,3 +1,10 @@ +QMainWindow#MainWindow{ + + background-image: url(:/Static/windPic.png); + background-color: rgba(0, 0, 0, 128); + +} + QWidget#MonitorTag{ background-color: #374065; @@ -15,36 +22,71 @@ QWidget#filterWidget{ } +QWidget#scrollArea, QWidget#fillWidget{ + + background-color: transparent; + border: none; + +} + + QLabel{ color: #DDDDE9; + font-family: Microsoft YaHei; + font-weight: bold; + +} + +QComboBox{ + + font-family: Microsoft YaHei; + font-weight: bold; + border: none; + background-color: transparent; + +} +QComboBox::drop-down{ + subcontrol-origin: padding; + subcontrol-position: top right; + width: 25px; + border:none; + image: url(:/Static/down.png) } -QPushButton#ClearanceButton, QPushButton#FlangeButton, QPushButton#GyroscopeButton{ +QPushButton#ClearanceButton, QPushButton#FlangeButton, QPushButton#GyroscopeButton, QPushButton#minButton, QPushButton#closeButton{ -border: none; + border: none; + font-family: Microsoft YaHei; + font-weight: bold; } QPushButton#monitorButton, QPushButton#flangeButton, QPushButton#clearanceButton, QPushButton#gyroscopeButton{ color: white; - background-color: #104469; + background-color: rgba(16,68,105, 80%); border-radius: 5px; border: 3px solid; border-color: #115C8E; - height: 30px + 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: #133852; + background-color: rgba(16,68,105, 80%); color: white; - height: 28px; + height: 35px; border: none; - border-radius: 1px; + border-radius: 5px; + font-family: Microsoft YaHei; + font-weight: bold; + font-size: 20px; } @@ -57,3 +99,67 @@ QListView#deviceList, QListView#flangeList{ border-color: #175E88; } + + + + +QGridLayout#monitorLayout{ + + background-color: #214055; + + +} + +QScrollBar::vertical{ + + width:10px; + background:rgba(37,85,105,100%); + padding-top:9px; + padding-bottom:9px; + + +} + +QScrollBar::handle:vertical{ + + width:20px; + border-image:url(:/Static/Sliding.png); + margin:0px,0px,0px,0px; + +} + +QScrollBar::handle:vertical:hover{ + + width:18px; + background:rgba(69, 178, 255,100%); + border-radius:4px; + min-height:20; + +} + + +QScrollBar::add-line:vertical{ + + height:0px; + width:18px; + subcontrol-position:bottom; + background:rgba(69, 178, 255,100%); + +} + +QScrollBar::sub-line:vertical{ + + height:0px; + width:18px; + subcontrol-position:top; + background:rgba(69, 178, 255,100%); + +} + +QScrollBar::add-page:vertical,QScrollBar::sub-page:vertical{ + + + background:rgba(37,85,105,100%); + +} + diff --git a/Static/close.png b/Static/close.png index eb176a042c90e64bce14ac6ef2ea99e07083cf83..e4111300929f6615f618b56c09af478216855b03 100644 GIT binary patch literal 625 zcmV-%0*?KOP)Px%D@jB_RCr$P+s#eHFc5~}Zz}$q+sP+^x>}9>CYOAq5~~6DD9rgl)VuL|bz|f$bE?L1vhQSbX&ACskHsG8;lw zdrw5Srp^07gb=j;{q65uq!-1z;qE?)X-K5fD`3djLEU)Z%*qJP=gl zH2|0h>hW3t3zy`?0yC5(DQnxy}3#^|*3IuHuSO9zXdAElz41m4( z+}*)^608AAYUTXa(?!S4U_8@QznSs0A1$UJaoJV6=D@gi?S}WqM_4T=@ z>(=R$K1w$ugH;9yf*2{}uDhT%FK**c;PYd1Odk|>_%^R?2vVMFI3KhGG9z}En+&wYruQ+|fcm({A87>l27M-@#?4|I$s zzxPX=?~SdzzIxDlEYC4@t9D<&@xQJOsLOxiyx=)r@TmJ3p zpZX!l_u)Wl$<$P5>>HL)>sF#HGOnKPPaN$&6dymI<~W_Ab7xhJUz3!*seKyph*L8Y zHj&JDJtM*vPh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