From 68a9956bcb5e99ec535cfbaf6171019291950391 Mon Sep 17 00:00:00 2001
From: duanshengchao <519970194@qq.com>
Date: Tue, 28 Oct 2025 18:50:59 +0800
Subject: [PATCH] =?UTF-8?q?feat:=E5=AE=9E=E6=97=B6=E5=91=8A=E8=AD=A6?=
=?UTF-8?q?=E5=88=97=E8=A1=A8=E5=AE=9E=E7=8E=B0=E6=97=A0=E6=95=B0=E6=8D=AE?=
=?UTF-8?q?=E6=97=B6=E5=B1=95=E7=A4=BA=E7=A9=BA=E8=A1=A8=E6=A0=BC=E6=A0=B7?=
=?UTF-8?q?=E5=BC=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
include/alarmEventRealTimeDock.h | 3 ++-
source/alarmEventRealTimeDock.cpp | 22 +++++++++++-----------
ui/alarmEventRealTimeDock.ui | 23 +++++++++++++++++++++--
3 files changed, 34 insertions(+), 14 deletions(-)
diff --git a/include/alarmEventRealTimeDock.h b/include/alarmEventRealTimeDock.h
index 966f1f4..ff899e6 100644
--- a/include/alarmEventRealTimeDock.h
+++ b/include/alarmEventRealTimeDock.h
@@ -33,7 +33,8 @@ private:
Ui::alarmEventRealTimeDock* ui;
AlarmEventDataView* m_tableView;
- QPropertyAnimation* m_animation;
+ QPropertyAnimation* m_animationExpand;
+ QPropertyAnimation* m_animationAlert;
bool m_isInAnimation;
QString m_curState;
};
diff --git a/source/alarmEventRealTimeDock.cpp b/source/alarmEventRealTimeDock.cpp
index 818815b..c490898 100644
--- a/source/alarmEventRealTimeDock.cpp
+++ b/source/alarmEventRealTimeDock.cpp
@@ -19,9 +19,9 @@ AlarmEventRealTimeDock::AlarmEventRealTimeDock(QWidget* parent)
m_tableView = new AlarmEventDataView(RealTime, this);
ui->tableLayout->addWidget(m_tableView);
- m_animation = new QPropertyAnimation(this, "geometry");
- m_animation->setDuration(120);
- connect(m_animation, &QPropertyAnimation::finished, this, [this]{m_isInAnimation = false;});
+ m_animationExpand = new QPropertyAnimation(this, "geometry");
+ m_animationExpand->setDuration(120);
+ connect(m_animationExpand, &QPropertyAnimation::finished, this, [this]{m_isInAnimation = false;});
ui->btnClose->setVisible(false);
connect(ui->btnOpen, &QPushButton::clicked, this, &AlarmEventRealTimeDock::onBtnClicked_open);
@@ -53,9 +53,9 @@ void AlarmEventRealTimeDock::expand()
{
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_animationExpand->setStartValue(startRect);
+ m_animationExpand->setEndValue(endRect);
+ m_animationExpand->start();
m_curState = "expand";
m_isInAnimation = true;
}
@@ -70,10 +70,10 @@ void AlarmEventRealTimeDock::collapse()
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();
+ QRect endRect(x(), parent->height() - ui->tobBar->height() - ui->alertWidget->height(), width(), height());
+ m_animationExpand->setStartValue(startRect);
+ m_animationExpand->setEndValue(endRect);
+ m_animationExpand->start();
m_curState = "collapse";
m_isInAnimation = true;
}
@@ -88,7 +88,7 @@ void AlarmEventRealTimeDock::updateGeometry()
int parentHeight = parent->height();
int selfWidth = parentWidth * 0.8;
int x = (parentWidth - selfWidth) * 0.5;
- int y = parentHeight - ui->tobBar->height();
+ int y = parentHeight - ui->tobBar->height() - ui->alertWidget->height();
if(m_curState == "expand")
y = parentHeight - this->height() - bottomMargin;
setGeometry(x, y, selfWidth, height());
diff --git a/ui/alarmEventRealTimeDock.ui b/ui/alarmEventRealTimeDock.ui
index 8699aea..6dcdba7 100644
--- a/ui/alarmEventRealTimeDock.ui
+++ b/ui/alarmEventRealTimeDock.ui
@@ -7,7 +7,7 @@
0
0
1177
- 250
+ 265
@@ -22,7 +22,7 @@ color: rgb(200, 200, 200);
-
+
0
@@ -38,6 +38,25 @@ color: rgb(200, 200, 200);
0
+ -
+
+
+
+ 0
+ 15
+
+
+
+
+ 16777215
+ 15
+
+
+
+ background-color: qradialgradient(spread:pad, cx:0.5, cy:0.6, radius:0.5, fx:0.5, fy:0.5, stop:0 rgba(200, 0, 0, 0), stop:1 rgba(255, 255, 255, 0));
+
+
+
-