From 1419e2efc6b7cfa70adf2dc90c415874ae5fa218 Mon Sep 17 00:00:00 2001 From: duanshengchao <519970194@qq.com> Date: Wed, 24 Sep 2025 12:10:51 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E5=9C=A8=E4=B8=BB=E7=AA=97=E5=8F=A3?= =?UTF-8?q?=E4=B8=AD=E6=B7=BB=E5=8A=A0=E5=AE=9E=E6=97=B6=E6=8A=A5=E8=AD=A6?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CMakeLists.txt | 3 + include/alarmEventMainDialog.h | 3 + include/alarmEventRealTimeDock.h | 39 + include/dashboardFrame.h | 3 + include/dvieMainWindow.h | 3 +- include/functionNavigationBar.h | 2 +- include/mainWindow.h | 1 + resource/PowerMaster.qrc | 7 + resource/images/icon_checked_blue.png | Bin 0 -> 307 bytes .../images/icon_configuration_blue - 副本.png | Bin 0 -> 449 bytes resource/images/icon_configuration_blue.png | Bin 0 -> 531 bytes .../images/icon_doubleArrow_down_default.png | Bin 0 -> 430 bytes .../images/icon_doubleArrow_down_hover.png | Bin 0 -> 431 bytes .../images/icon_doubleArrow_up_default.png | Bin 0 -> 431 bytes resource/images/icon_doubleArrow_up_hover.png | Bin 0 -> 432 bytes resource/images/icon_search_blue.png | Bin 0 -> 550 bytes source/alarmEventDataView.cpp | 9 + source/alarmEventMainDialog.cpp | 6 + source/alarmEventRealTimeDock.cpp | 114 +++ source/dashboardFrame.cpp | 18 +- source/dvieMainWindow.cpp | 16 +- source/functionNavigationBar.cpp | 10 +- source/mainWindow.cpp | 15 +- ui/alarmEventMainDialog.ui | 174 ++-- ui/alarmEventRealTimeDock.ui | 816 ++++++++++++++++++ 25 files changed, 1135 insertions(+), 104 deletions(-) create mode 100644 include/alarmEventRealTimeDock.h create mode 100644 resource/images/icon_checked_blue.png create mode 100644 resource/images/icon_configuration_blue - 副本.png create mode 100644 resource/images/icon_configuration_blue.png create mode 100644 resource/images/icon_doubleArrow_down_default.png create mode 100644 resource/images/icon_doubleArrow_down_hover.png create mode 100644 resource/images/icon_doubleArrow_up_default.png create mode 100644 resource/images/icon_doubleArrow_up_hover.png create mode 100644 resource/images/icon_search_blue.png create mode 100644 source/alarmEventRealTimeDock.cpp create mode 100644 ui/alarmEventRealTimeDock.ui diff --git a/CMakeLists.txt b/CMakeLists.txt index 9edc705..5cfe53b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -51,6 +51,7 @@ set(H_HEADER_FILES include/alarmEventGlobal.h include/alarmEventMainDialog.h include/alarmEventDataView.h + include/alarmEventRealTimeDock.h ) set(CPP_SOURCE_FILES @@ -83,6 +84,7 @@ set(CPP_SOURCE_FILES source/httpRequestManager.cpp source/alarmEventMainDialog.cpp source/alarmEventDataView.cpp + source/alarmEventRealTimeDock.cpp ) set(UI_FILES @@ -102,6 +104,7 @@ set(UI_FILES ui/dateTimeSelectionPanel.ui ui/dpConfigurationDialog.ui ui/alarmEventMainDialog.ui + ui/alarmEventRealTimeDock.ui ) set(UTIL_FILES diff --git a/include/alarmEventMainDialog.h b/include/alarmEventMainDialog.h index e4e6d84..7d99e04 100644 --- a/include/alarmEventMainDialog.h +++ b/include/alarmEventMainDialog.h @@ -23,6 +23,9 @@ public: signals: void sgl_hide(); +protected: + void showEvent(QShowEvent* event) override; + public slots: void onBtnClicked_close(); diff --git a/include/alarmEventRealTimeDock.h b/include/alarmEventRealTimeDock.h new file mode 100644 index 0000000..44faf63 --- /dev/null +++ b/include/alarmEventRealTimeDock.h @@ -0,0 +1,39 @@ +#ifndef ALARMEVENTREALTIMEDOCK_H +#define ALARMEVENTREALTIMEDOCK_H + +#include + +QT_BEGIN_NAMESPACE +namespace Ui { +class alarmEventRealTimeDock; +} +QT_END_NAMESPACE + +class QPropertyAnimation; +class AlarmEventRealTimeDock : public QWidget +{ + Q_OBJECT + +public: + AlarmEventRealTimeDock(QWidget *parent = nullptr); + ~AlarmEventRealTimeDock(); + + void updateGeometry(); + +public slots: + void onBtnClicked_open(); + void onBtnClicked_close(); + void onBtnClicked_confirmAll(); + void onBtnClicked_checkAll(); + +private: + void expand(); + void collapse(); + + Ui::alarmEventRealTimeDock* ui; + QPropertyAnimation* m_animation; + bool m_isInAnimation; + QString m_curState; +}; + +#endif diff --git a/include/dashboardFrame.h b/include/dashboardFrame.h index 05175fb..6c48b01 100644 --- a/include/dashboardFrame.h +++ b/include/dashboardFrame.h @@ -22,6 +22,7 @@ class DateTimeWidget; class TimeLineWidget; class DataPanel; class dpConfigurationDialog; +class AlarmEventRealTimeDock; class AlarmEventMainDialog; namespace dashboardFrame { @@ -54,6 +55,7 @@ public: protected: bool eventFilter(QObject*, QEvent*) override; void resizeEvent(QResizeEvent*) override; + void moveEvent(QMoveEvent*) override; void dragEnterEvent(QDragEnterEvent* event) override; //void dragMoveEvent(QDragMoveEvent* event) override; void dragLeaveEvent(QDragLeaveEvent* event) override; @@ -113,6 +115,7 @@ private: TimeLineWidget* m_pTimeLineWidget; dpConfigurationDialog* m_pPanelConfigurationDialog; + AlarmEventRealTimeDock* m_pAlarmEventRealTimeDock; AlarmEventMainDialog* m_pAlarmEventMainDialog; QTimer* m_pTimer_RealTime; diff --git a/include/dvieMainWindow.h b/include/dvieMainWindow.h index f852e9f..68ebae1 100644 --- a/include/dvieMainWindow.h +++ b/include/dvieMainWindow.h @@ -31,7 +31,8 @@ public: void removeSecondartWindow(QString&); protected: - virtual void resizeEvent(QResizeEvent*) override; + bool event(QEvent*) override; + //void resizeEvent(QResizeEvent*) override; private: Ui::dvieMainWindow* ui; diff --git a/include/functionNavigationBar.h b/include/functionNavigationBar.h index 7d72c78..08e318f 100644 --- a/include/functionNavigationBar.h +++ b/include/functionNavigationBar.h @@ -20,7 +20,7 @@ public: ~FunctionNavigationBar(); void expand(); - void shrink(); + void collapse(); protected: void enterEvent(QEnterEvent*); diff --git a/include/mainWindow.h b/include/mainWindow.h index 3809d3e..54df348 100644 --- a/include/mainWindow.h +++ b/include/mainWindow.h @@ -1,6 +1,7 @@ #ifndef MAINWINDOW_H #define MAINWINDOW_H +#include "alarmEventRealTimeDock.h" #include QT_BEGIN_NAMESPACE diff --git a/resource/PowerMaster.qrc b/resource/PowerMaster.qrc index 5dbb656..b3fed37 100644 --- a/resource/PowerMaster.qrc +++ b/resource/PowerMaster.qrc @@ -1,5 +1,12 @@ + images/icon_configuration_blue.png + images/icon_checked_blue.png + images/icon_search_blue.png + images/icon_doubleArrow_down_default.png + images/icon_doubleArrow_down_hover.png + images/icon_doubleArrow_up_default.png + images/icon_doubleArrow_up_hover.png images/icon_first.png images/icon_last.png images/icon_next.png diff --git a/resource/images/icon_checked_blue.png b/resource/images/icon_checked_blue.png new file mode 100644 index 0000000000000000000000000000000000000000..d4a27405a7c5f9bc1094c76505de813e65b9ed5d GIT binary patch literal 307 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjoCO|{#S9GG!XV7ZFl!D-#Zylg z$B>FSZ>RY39a0cz-Pz*ipUfhCarTS3B3Gne9;&r%@|D@OAuVUNz%OQ>-EX{SEwkU# zU&&)&rs?+D_)V*k{z6~D;zHg7rf)7N@7(uXdaisFWAcn**8cz7z3XzARyp=4RBENg z9Nyb9>$z8I_eBPyBXhVWEPN)?&|}!os&cLAk?j1BwR;~pGURNpN?2i87AnAS`;6%e z?8Bs`;awzV|rOA0J< z6zySFkh#97ux9oa;edB8llctAUnw`AntMd+FT<4LAFrk#x=;x8FoUP7pUXO@geCxW CFL`4C literal 0 HcmV?d00001 diff --git a/resource/images/icon_configuration_blue - 副本.png b/resource/images/icon_configuration_blue - 副本.png new file mode 100644 index 0000000000000000000000000000000000000000..f950b9225c1409cb4ce9cf3cf0231f233bc9d30d GIT binary patch literal 449 zcmV;y0Y3hTP)v`xX*JGZ8Hfv8`W_eS)j%2W$~( zGZJkA{f6o*+zCa{2dK>mHE|yX`rf^w^opQ?S>1EbnRm{8lga#x0+thGwW%hlrYAtc z2>}*Lg?yKF6Ipvn0qsFk@{6&VWr5@#Sld8a29gUT`S6f`+2qdZ5tg-$BoDQkEd}|p zrIjEV&)F@lc*%F}Y#CTzzAeD|dT?Va$>~W?LzjT{2}w$YhUHuXNfBAQK|JYMLcm=D zmVu9a|H{_m`0ZO;i-Z$+834<|VDHja7ZUJU1SG|v0PE4*7KK7a)~*XQj>nd5AnCI=WZzKkY0Y}3Kw5U5 zyN)LJkWb*xfB#4O@l_F(S=KEqB<+j?tOLt?*ox?^KDMlbERQpnov)xN`SjLxppbXP)&ZaGS_&{RQ>@0l|qqa}L??R<;qAPVpHD60$I`%)a;L=nW^SHq`w*Xo0TdW>g>`OBB2;bZSkoY?mJ8L%MLm2iXzJD(<&izfM#csV5 zpVZ&SWm0RB*f&-?xxuKNz=tznfCUHKnc}bV^A%G2an+7XQa>dzXR(8KIIKvWV!05%0xKZZtGOGjmj?Ezf>7$2w1&=U3GWIKGA zst6$fI|^ufGsUY0An{(M099MWSNA^4?b#n&wD6Cd-Qk*&cn_8`uX;@v{-ezr6{OZ4 z9~IQG=P6sYqSC0CI_$(6rNd6FQEAwfEfU{H`LB=S()GAz^|#@ld2o2qPv&2}eglqZ VAdW%N2f6?N002ovPDHLkV1fpP?JNKQ literal 0 HcmV?d00001 diff --git a/resource/images/icon_doubleArrow_down_default.png b/resource/images/icon_doubleArrow_down_default.png new file mode 100644 index 0000000000000000000000000000000000000000..c36a87a8b8a68b545ce6b68818cc52ab88f3410e GIT binary patch literal 430 zcmV;f0a5;mP)yG*%vEQKmCI z<8YG;m}F92g~Btjyrit0!)-doU1xZ{J|Pm{@bc72q|bQ3WHI{HBw)h$a_9@E9xX=} zBVt$^2TypINu^2nOhUW)>Zox#TO2zD3<4yA;UN;y;7uf=!+j)LgO}BxFOE#F!?f+x zlQgZfN8F?Dfy*RZZcbU0=?rHAUYP)70`C1JbT|`mx6XPSKH$C&9Q`D$aCDMjQuT77 zJ}OPfI85yl8{izK)tptfR6XkyE;yXzT)k@&#z{Ec9GOs`eOa7a;l2{I>D6ryhWkpi z0&gM_9quF18vN%kmFabuw>{o3UEL(wyScwai|~4h4&Y{q4&l1QAHd6^O^?3q+e$jD YFKq!I2+j-Hpa1{>07*qoM6N<$g4P1L3IG5A literal 0 HcmV?d00001 diff --git a/resource/images/icon_doubleArrow_down_hover.png b/resource/images/icon_doubleArrow_down_hover.png new file mode 100644 index 0000000000000000000000000000000000000000..dc0472029122e5d9ff63ea195a54c47b6c69ac43 GIT binary patch literal 431 zcmV;g0Z{&lP)~6DU2j+M0cBPvPsq+I*{Z1zHf#JLi^g;T0xIcn8u1zSu5x{!!a#p zn2N`KCT_#w;#y^~;_hk=2hMO@z7Pow|H*2S7%t(Mu+9DNrt;nR!evi2M`lZgwQ>9e zCnV!F37<_=Cs*){&k6lJa|##-NCd+}B%;CFNJNMGNF;;n8s%_m`W>cgmp!O$UA({{ zrkk0|CR`?$Su)cZPAGpROaP%`=_9cXPMCO5S&Y9C3PC8!nNfds9D2b3TZ23V-C0*u4MDs$(nZ+&eCwRirw5fpG2 zWD?W?9!!GPfP0sqj_}bu>6!E@K^@_2p-*F}rdX(1v`EgpND!&|w%5KL4)^QaB4OPQ z)wc=^pY;*p@b1?6FT6w|Hwi4@WBjC#OQ$gWE8z&QmT-b+C1MUY_2701Q_IvuO=C1q zdPJrLIN{5&$-=ozr}^z@9L&;rEY;PfL$SPcnM4qHFbP%z?p=a4fP0f*E#R#sqE~%l zd+n%Z*tWwktd}Nl`Tz^KZrXX(B#4CDXr>QKFHJHMZQywcCwNxE=MRUeWor7Ww-4ki ZegJSbA3`wU#>xNy002ovPDHLkV1jd!xf}oh literal 0 HcmV?d00001 diff --git a/resource/images/icon_doubleArrow_up_hover.png b/resource/images/icon_doubleArrow_up_hover.png new file mode 100644 index 0000000000000000000000000000000000000000..bdfaf3611b049f5d74a3996ea9ae0008dfa8067b GIT binary patch literal 432 zcmV;h0Z;ykP)Vi~; z3UbcGFJxfiv#3~!ZRwDKLP_J)Nt{$jJ?WMxzW46p8xjQj`0oLjj!fd`ECaU)iDr-+;F$!L9HXB=}Z%gA#!0hzYsO!kAF^CO4nUrMK~>U+(9(H7QrD|@0M(_-BpQJ?CJ~l^dzT0+z`aR?HQ==+1`9g2 z-S(hl*tWwk?57gyfY3KpJKr{mexz?NW^_<|D*2VD1J6ph!Pg~_y!~)|)=H@3tKL2W aU-1DJ73aa{`?MDT00000@?kEP)EK|DRn_1A2x$hRsitoLfY!Gr_t37Yd%(-(W zivDZFEt#$(ZyMx7i~QLD9T=pQS0ClsUlp!?lPL@Q&LX82S%!ZG>9>V+r`ePz;aw-! za|Y;_D+YXK6IwGTz1f#78PERXZ3}ea#ZDV7nGEVYD^96e^AJxvx5&p{q#KD;N(p4P zu;djVghl?K{1|y7Dnbq9x$_+OEGmhGu1px@OSPRQe zLIk`WB4B{NSfE?YN-k03pCyzo$|iKV)0?qKR|fgKR5u!bAD-hP?s`|obfpc_O`Pz+T@xtsetupUi(this); setWindowFlags(Qt::FramelessWindowHint); @@ -17,6 +18,11 @@ AlarmEventMainDialog::~AlarmEventMainDialog() delete ui; } +void AlarmEventMainDialog::showEvent(QShowEvent* event) +{ + QDialog::showEvent(event); +} + void AlarmEventMainDialog::setMode(MainDialogMode mode) { if(mode == RealTime) diff --git a/source/alarmEventRealTimeDock.cpp b/source/alarmEventRealTimeDock.cpp new file mode 100644 index 0000000..70990d6 --- /dev/null +++ b/source/alarmEventRealTimeDock.cpp @@ -0,0 +1,114 @@ +#include "alarmEventRealTimeDock.h" +#include "./ui_alarmEventRealTimeDock.h" + +#include +#include + +#define bottomMargin 0 +AlarmEventRealTimeDock::AlarmEventRealTimeDock(QWidget* parent) + : QWidget(parent) + , ui(new Ui::alarmEventRealTimeDock) +{ + ui->setupUi(this); + setAttribute(Qt::WA_TranslucentBackground); + + m_isInAnimation = false; + m_curState = "collapse"; + + m_animation = new QPropertyAnimation(this, "geometry"); + m_animation->setDuration(120); + connect(m_animation, &QPropertyAnimation::finished, this, [this]{m_isInAnimation = false;}); + + ui->btnClose->setVisible(false); + connect(ui->btnOpen, &QPushButton::clicked, this, &AlarmEventRealTimeDock::onBtnClicked_open); + connect(ui->btnClose, &QPushButton::clicked, this, &AlarmEventRealTimeDock::onBtnClicked_close); + connect(ui->btnConfirmAll, &QPushButton::clicked, this, &AlarmEventRealTimeDock::onBtnClicked_confirmAll); + connect(ui->btnCheckAll, &QPushButton::clicked, this, &AlarmEventRealTimeDock::onBtnClicked_checkAll); + + /*if(parent) + { + int parentWidth = parent->width(); + int parentHeight = parent->height(); + int selfWidth = parentWidth * 0.8; + int x = (parentWidth - selfWidth) * 0.5; + int y = parentHeight - ui->tobBar->height(); + setGeometry(x, y, selfWidth, height()); + }*/ +} + +AlarmEventRealTimeDock::~AlarmEventRealTimeDock() +{} + +void AlarmEventRealTimeDock::expand() +{ + if(m_isInAnimation || m_curState == "expand" ) + return; + + QWidget* parent = this->parentWidget(); + if(parent) + { + QRect startRect(x(), y(), width(), height()); + QRect endRect(x(), parent->height() - height() - bottomMargin, width(), height()); + m_animation->setStartValue(startRect); + m_animation->setEndValue(endRect); + m_animation->start(); + m_curState = "expand"; + m_isInAnimation = true; + } +} + +void AlarmEventRealTimeDock::collapse() +{ + if(m_isInAnimation || m_curState == "collapse" ) + return; + + QWidget* parent = this->parentWidget(); + if(parent) + { + QRect startRect(x(), y(), width(), height()); + QRect endRect(x(), parent->height() - ui->tobBar->height(), width(), height()); + m_animation->setStartValue(startRect); + m_animation->setEndValue(endRect); + m_animation->start(); + m_curState = "collapse"; + m_isInAnimation = true; + } +} + +void AlarmEventRealTimeDock::updateGeometry() +{ + QWidget* parent = this->parentWidget(); + if(parent) + { + int parentWidth = parent->width(); + int parentHeight = parent->height(); + int selfWidth = parentWidth * 0.8; + int x = (parentWidth - selfWidth) * 0.5; + int y = parentHeight - ui->tobBar->height(); + if(m_curState == "expand") + y = parentHeight - this->height() - bottomMargin; + setGeometry(x, y, selfWidth, height()); + } +} + +void AlarmEventRealTimeDock::onBtnClicked_open() +{ + expand(); + ui->btnOpen->setVisible(false); + ui->btnClose->setVisible(true); +} + +void AlarmEventRealTimeDock::onBtnClicked_close() +{ + collapse(); + ui->btnOpen->setVisible(true); + ui->btnClose->setVisible(false); +} + +void AlarmEventRealTimeDock::onBtnClicked_confirmAll() +{} + +void AlarmEventRealTimeDock::onBtnClicked_checkAll() +{} + + diff --git a/source/dashboardFrame.cpp b/source/dashboardFrame.cpp index a453c2c..b9c4394 100644 --- a/source/dashboardFrame.cpp +++ b/source/dashboardFrame.cpp @@ -13,6 +13,7 @@ #include "dataPanel/dpConfigurationDialog.h" #include "dateTimeWidget.h" #include "util/TimeLine/timeLineWidget.h" +#include "alarmEventRealTimeDock.h" #include "alarmEventMainDialog.h" #include @@ -34,6 +35,7 @@ DashboardFrame::DashboardFrame(const QString& strName, dashboardFrame::frameType , m_curOperationDashboard(nullptr) , m_pPanelSelectionDialog(nullptr) , m_pPanelConfigurationDialog(nullptr) + , m_pAlarmEventRealTimeDock(nullptr) , m_pAlarmEventMainDialog(nullptr) { ui->setupUi(this); @@ -43,7 +45,11 @@ DashboardFrame::DashboardFrame(const QString& strName, dashboardFrame::frameType setObjectName(strName); m_pParentWindow = parent; m_type = fType; - if(m_type == dashboardFrame::ft_secondary) //只有主window具有报警提示 + if(m_type == dashboardFrame::ft_main) //只有主window具有报警提示 + { + m_pAlarmEventRealTimeDock = new AlarmEventRealTimeDock(this); + } + else { ui->btnAllEvent->setVisible(false); ui->btnAlarm->setVisible(false); @@ -147,9 +153,19 @@ void DashboardFrame::resizeEvent(QResizeEvent* event) m_curActiveDashboard->resizePanel(ratioX, ratioY); } + if(m_pAlarmEventRealTimeDock) + m_pAlarmEventRealTimeDock->updateGeometry(); + QWidget::resizeEvent(event); } +void DashboardFrame::moveEvent(QMoveEvent* event) +{ + Q_UNUSED(event); + if(m_pAlarmEventRealTimeDock) + m_pAlarmEventRealTimeDock->updateGeometry(); +} + void DashboardFrame::dragEnterEvent(QDragEnterEvent* event) { const QMimeData* mimeData = event->mimeData(); diff --git a/source/dvieMainWindow.cpp b/source/dvieMainWindow.cpp index bf66164..d45f139 100644 --- a/source/dvieMainWindow.cpp +++ b/source/dvieMainWindow.cpp @@ -10,7 +10,6 @@ DvieMainWindow::DvieMainWindow(QWidget *parent) , ui(new Ui::dvieMainWindow) , m_pTransparentMask(nullptr) , m_pDashboardFrame(nullptr) - { ui->setupUi(this); setProperty("windowType", "main"); @@ -24,13 +23,24 @@ DvieMainWindow::~DvieMainWindow() delete ui; } -void DvieMainWindow::resizeEvent(QResizeEvent* event) +bool DvieMainWindow::event(QEvent* event) +{ + if(event->type() == QEvent::Resize) + { + if(m_pTransparentMask && m_pTransparentMask->isVisible()) + m_pTransparentMask->setGeometry(ui->topWidget->geometry()); + } + + return QMainWindow::event(event); +} + +/*void DvieMainWindow::resizeEvent(QResizeEvent* event) { if(m_pTransparentMask && m_pTransparentMask->isVisible()) m_pTransparentMask->setGeometry(ui->topWidget->geometry()); QMainWindow::resizeEvent(event); -} +}*/ void DvieMainWindow::showTransparentMask() { diff --git a/source/functionNavigationBar.cpp b/source/functionNavigationBar.cpp index 452e1ca..1bcde87 100644 --- a/source/functionNavigationBar.cpp +++ b/source/functionNavigationBar.cpp @@ -33,7 +33,7 @@ void FunctionNavigationBar::initialize() connect(ui->funBtn_TCC, SIGNAL(clicked()), this, SLOT(onBtnClicked_funBtn())); m_pLastFunButton = ui->funBtn_Dvie; - m_strCurState = "shrink"; + m_strCurState = "collapse"; m_bInAnimation = false; m_pAni_geo = new QPropertyAnimation(this, "geometry"); m_pAni_geo->setDuration(100); @@ -57,7 +57,7 @@ void FunctionNavigationBar::enterEvent(QEnterEvent* e) void FunctionNavigationBar::leaveEvent(QEvent* e) { Q_UNUSED(e); - shrink(); + collapse(); } void FunctionNavigationBar::expand() @@ -79,9 +79,9 @@ void FunctionNavigationBar::expand() m_strCurState = "expand"; } } -void FunctionNavigationBar::shrink() +void FunctionNavigationBar::collapse() { - if(m_bInAnimation || m_strCurState == "shrink" ) + if(m_bInAnimation || m_strCurState == "collapse" ) return; QWidget* pParent = parentWidget(); @@ -95,7 +95,7 @@ void FunctionNavigationBar::shrink() m_pAni_geo->setStartValue(startRect); m_pAni_geo->setEndValue(endRect); m_pAni_geo->start(); - m_strCurState = "shrink"; + m_strCurState = "collapse"; } } diff --git a/source/mainWindow.cpp b/source/mainWindow.cpp index 4fbdd3b..6212e13 100644 --- a/source/mainWindow.cpp +++ b/source/mainWindow.cpp @@ -8,6 +8,9 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) , ui(new Ui::MainWindow) + , m_funNavigationBar(nullptr) + , m_pDvieMainWindow(nullptr) + , m_pTccMainWindow(nullptr) { ui->setupUi(this); @@ -27,14 +30,14 @@ void MainWindow::initialize() ui->hLayout_TCC->addWidget(m_pTccMainWindow); ui->stackedWidget->setCurrentIndex(0); - m_funNavigationBar = new FunctionNavigationBar(this); + /*m_funNavigationBar = new FunctionNavigationBar(this); connect(m_funNavigationBar, SIGNAL(sgl_funBtnClicke(QString)), this, SLOT(onSignal_funBtnClicked(QString))); // QPoint originPoint = mapToGlobal(QPoint(0, 0)); 只有dialog需要做此计算 int nWidth = m_funNavigationBar->width(); int nY = (this->height() - m_funNavigationBar->height()) * 0.5; m_funNavigationBar->setGeometry(0, nY, nWidth, m_funNavigationBar->height()); m_funNavigationBar->raise(); - m_funNavigationBar->show(); + m_funNavigationBar->show();*/ } bool MainWindow::event(QEvent* event) @@ -42,9 +45,11 @@ bool MainWindow::event(QEvent* event) //qDebug() << event->type(); if(event->type() == QEvent::Resize || event->type() == QEvent::Move) { - //int nHeight = this->height() * 0.8; - int nY = (this->height() - m_funNavigationBar->height()) * 0.5; - m_funNavigationBar->setGeometry(0, nY, m_funNavigationBar->width(), m_funNavigationBar->height()); + if(m_funNavigationBar) + { + int nY = (this->height() - m_funNavigationBar->height()) * 0.5; + m_funNavigationBar->setGeometry(0, nY, m_funNavigationBar->width(), m_funNavigationBar->height()); + } } return QMainWindow::event(event); diff --git a/ui/alarmEventMainDialog.ui b/ui/alarmEventMainDialog.ui index 01340b2..9e74403 100644 --- a/ui/alarmEventMainDialog.ui +++ b/ui/alarmEventMainDialog.ui @@ -7,7 +7,7 @@ 0 0 1539 - 1005 + 992 @@ -652,7 +652,7 @@ QHeaderView } QHeaderView::section { - font: 700 12pt "微软雅黑"; + font: 700 12pt "黑体"; color: rgb(250, 250, 250); background-color:transparent; border:0px; @@ -666,15 +666,14 @@ QHeaderView::section:horizontal:last QTableView { outline:0px; + border:0px; background-color: transparent; + font: 11pt "黑体"; } QTableView::item { - font: 12pt "黑体"; color: rgb(250, 250, 250); background-color:transparent; - border:0px; - border-right: 1px solid rgb(60,60,60); } QTableView::item:hover { @@ -683,90 +682,89 @@ QTableView::item:selected { } - - - - 40 - 50 - 931 - 411 - + + + 15 - - Qt::TextElideMode::ElideNone - - - false - - - false - - - - 新建行 - - - - - 新建行 - - - - - 新建行 - - - - - 序号 - - - - - 时间 - - - - - 厂站 - - - - - 详情 - - - - - 类型 - - - - - 级别 - - - - - 操作 - - - - - 1 - + + + + Qt::TextElideMode::ElideNone + + + false + + + false + + + + 新建行 + + + + + 新建行 + + + + + 新建行 + + + + + 序号 + + + + + 时间 + + + + + 厂站 + + + + + 详情 + + + + + 类型 + + + + + 级别 + + + + + 操作 + + + + + 1 + + + + + 2025-09-17 16:51:01 + + + + + 灵州换流站 + + + - - - 2025-09-17 16:51:01 - - - - - 灵州换流站 - - - + @@ -851,7 +849,7 @@ border:1px solid rgb(100,100,100); - font: 11pt "黑体"; + font: 10pt "黑体"; 共100条记录 diff --git a/ui/alarmEventRealTimeDock.ui b/ui/alarmEventRealTimeDock.ui new file mode 100644 index 0000000..9e2f643 --- /dev/null +++ b/ui/alarmEventRealTimeDock.ui @@ -0,0 +1,816 @@ + + + alarmEventRealTimeDock + + + + 0 + 0 + 1177 + 250 + + + + Form + + + QLabel +{ +font: 10pt "黑体"; +color: rgb(200, 200, 200); +} + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + QWidget #contentWidget +{ +background-color: rgba(36,43,50,215); +border-top-left-radius:6px; +border-top-right-radius:6px; +} + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 36 + + + + + 16777215 + 36 + + + + QWidget #tobBar +{ + background-color: transparent; +} + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 342 + 0 + + + + + 342 + 16777215 + + + + + + 140 + 10 + 16 + 16 + + + + + + + + + + 20 + 10 + 16 + 16 + + + + border-image: url(:/images/icon_alarm.png); + + + + + + + + + 45 + 10 + 61 + 16 + + + + 实时告警: + + + + + + 105 + 10 + 31 + 16 + + + + color: rgb(67,160,249); + + + 0 + + + Qt::AlignmentFlag::AlignCenter + + + + + + + + Qt::Orientation::Horizontal + + + + 184 + 20 + + + + + + + + + 120 + 0 + + + + + 120 + 16777215 + + + + QWidget #openCloseWidget +{ + +} + + + + + 35 + 6 + 51 + 23 + + + + ArrowCursor + + + QPushButton +{ + border-image: url(:/images/icon_doubleArrow_down_default.png); +} +QPushButton:hover +{ + border-image: url(:/images/icon_doubleArrow_down_hover.png); +} +QPushButton:pressed +{ + border-image: url(:/images/icon_doubleArrow_down_default.png); +} + + + + + + + + + 35 + 6 + 51 + 23 + + + + ArrowCursor + + + QPushButton +{ + border-image: url(:/images/icon_doubleArrow_up_default.png); +} +QPushButton:hover +{ + border-image: url(:/images/icon_doubleArrow_up_hover.png); +} +QPushButton:pressed +{ + border-image: url(:/images/icon_doubleArrow_up_default.png); +} + + + + + + + + + + + Qt::Orientation::Horizontal + + + + 183 + 20 + + + + + + + + + 342 + 0 + + + + + 342 + 342 + + + + + + + + + 10 + 12 + 12 + 12 + + + + background-color: rgb(255, 85, 0); +border-radius:6px; + + + + + + + + + 25 + 10 + 31 + 16 + + + + 事故 + + + + + + 53 + 10 + 31 + 16 + + + + color: rgb(250, 250, 250); + + + 0 + + + + + + 136 + 10 + 31 + 16 + + + + color: rgb(250, 250, 250); + + + 0 + + + + + + 108 + 10 + 31 + 16 + + + + 异常 + + + + + + 93 + 12 + 12 + 12 + + + + background-color: rgb(255, 170, 0); +border-radius:6px; + + + + + + + + + 219 + 10 + 31 + 16 + + + + color: rgb(250, 250, 250); + + + 0 + + + + + + 176 + 12 + 12 + 12 + + + + background-color: rgb(0, 170, 255); +border-radius:6px; + + + + + + + + + 191 + 10 + 31 + 16 + + + + 预警 + + + + + + 302 + 10 + 31 + 16 + + + + color: rgb(250, 250, 250); + + + 0 + + + + + + 274 + 10 + 31 + 16 + + + + 告知 + + + + + + 259 + 12 + 12 + 12 + + + + background-color: rgb(0, 170, 0); +border-radius:6px; + + + + + + + + + + + + + + QWidget #tableView +{ + background-color: rgba(54, 62, 74,90); +} + +QPushButton +{ +color: rgb(250, 250, 250); +font: 10pt "黑体"; +border:0px; +background-color:transparent; +} +QPushButton:hover +{ +color: rgb(67,160,249); +} +QPushButton:pressed +{ +color: rgb(250, 250, 250); +} + +QHeaderView +{ + background-color: rgba(11, 26, 33, 160); +} +QHeaderView::section +{ + font: 700 10pt "黑体"; + color: rgb(250, 250, 250); + background-color:transparent; + border:0px; + border-right: 1px solid rgb(60,60,60); +} +QHeaderView::section:horizontal:last +{ + border-right: 0px; +} + +QTableView +{ + outline:0px; + border:0px; + background-color: transparent; + font: 10pt "黑体"; +} +QTableView::item +{ + color: rgb(250, 250, 250); + background-color:transparent; +} +QTableView::item:hover +{ +} +QTableView::item:selected +{ +} + + + + 15 + + + 15 + + + 0 + + + + + Qt::TextElideMode::ElideNone + + + false + + + false + + + + 新建行 + + + + + 新建行 + + + + + 新建行 + + + + + 新建行 + + + + + 新建行 + + + + + 序号 + + + + + 时间 + + + + + 厂站 + + + + + 详情 + + + + + 类型 + + + + + 级别 + + + + + 操作 + + + + + 1 + + + + + 2025-09-17 16:51:01 + + + + + 灵州换流站 + + + + + 2 + + + + + 3 + + + + + 4 + + + + + 5 + + + + + + + + + 0 + 26 + + + + + 16777215 + 26 + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Qt::Orientation::Horizontal + + + + 883 + 20 + + + + + + + + 15 + + + + + + 81 + 26 + + + + + 81 + 26 + + + + QPushButton +{ +icon-size:18px; +icon: url(:/images/icon_checked_blue.png); +} + + + 全部确认 + + + + + + + + 81 + 26 + + + + + 81 + 26 + + + + QPushButton +{ +icon-size:18px; +icon: url(:/images/icon_search_blue.png); +} + + + 查看全部 + + + + + + + + 61 + 26 + + + + + 61 + 26 + + + + QPushButton +{ +icon-size:18px; +icon: url(:/images/icon_configuration_blue.png); +} + + + 设置 + + + + + + + + + + + + + + + + + + + + +