feat:初始化wuhan_QT界面代码

This commit is contained in:
xu
2026-09-09 17:00:37 +08:00
commit 40473ad10b
537 changed files with 23934 additions and 0 deletions
+35
View File
@@ -0,0 +1,35 @@
#include "alarmbanner.h"
#include <QHBoxLayout>
#include <QLabel>
#include "global.h"
AlarmBanner::AlarmBanner(QWidget* parent)
: QWidget(parent)
{
setFixedHeight(54);
setStyleSheet("background: transparent;");
QHBoxLayout* lay = new QHBoxLayout(this);
lay->setContentsMargins(0, 0, 0, 0);
m_label = new QLabel(this);
m_label->setAlignment(Qt::AlignCenter);
m_label->setProperty("alert", true);
m_label->setStyleSheet("font-size:30px;font-weight:700;");
lay->addWidget(m_label);
hide(); // 默认隐藏
}
void AlarmBanner::showAlarm(const QString& text)
{
m_label->setText(text);
startBlink(m_label, "blink");
show();
}
void AlarmBanner::clear()
{
stopBlink(m_label, "blink");
hide();
}