From 2135b69eccd5d719a70629d65a1c52120b2bb6d9 Mon Sep 17 00:00:00 2001 From: HwangKC Date: Mon, 17 Mar 2025 12:24:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=91=8A=E8=AD=A6=E4=B8=AD?= =?UTF-8?q?=EF=BC=8C=E5=A6=82=E6=9E=9C=E5=91=8A=E8=AD=A6=E6=95=B0=E5=80=BC?= =?UTF-8?q?=E4=B8=BA0=E5=88=99=E4=B8=8D=E6=98=BE=E7=A4=BA=E8=AF=A5?= =?UTF-8?q?=E6=9D=A1=E4=BF=A1=E6=81=AF=E3=80=82=E4=B8=8D=E5=A4=9F=E4=B8=A5?= =?UTF-8?q?=E8=B0=A8=EF=BC=8C=E9=9C=80=E8=A6=81=E7=A1=AE=E8=AE=A4=E8=A7=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- applications/EmsShower/customdisplaypanel.cpp | 8 ++++++-- applications/EmsShower/mainwindow.cpp | 5 +++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/applications/EmsShower/customdisplaypanel.cpp b/applications/EmsShower/customdisplaypanel.cpp index 213d204..78ee39d 100644 --- a/applications/EmsShower/customdisplaypanel.cpp +++ b/applications/EmsShower/customdisplaypanel.cpp @@ -284,11 +284,15 @@ void CustomDisplayPanel::UpdateAlarm(OpenJson &json) m_pTableWidget->setUpdatesEnabled(false); for(size_t i=0; iinsertRow(0); auto& node = nodeTable[i]; + std::string value = node["value"].s(); + if (value == "0") + continue; + std::string s = node["time"].s(); std::string title = node["signal"].s(); - std::string value = node["value"].s(); + + m_pTableWidget->insertRow(0); QTableWidgetItem *item0 = new QTableWidgetItem(QString::fromStdString(s)); item0->setTextAlignment(Qt::AlignLeft | Qt::AlignVCenter); // 右对齐+垂直居中 diff --git a/applications/EmsShower/mainwindow.cpp b/applications/EmsShower/mainwindow.cpp index a650d48..9172b66 100644 --- a/applications/EmsShower/mainwindow.cpp +++ b/applications/EmsShower/mainwindow.cpp @@ -73,7 +73,8 @@ MainWindow::~MainWindow() void MainWindow::getConfiguration(QString iniFilePath) { - m_pSettings = new QSettings(iniFilePath, QSettings::IniFormat); + if (m_pSettings == nullptr) + m_pSettings = new QSettings(iniFilePath, QSettings::IniFormat); m_version = m_pSettings->value("version/ver").toString(); m_modbus_type = m_pSettings->value("modbus/type").toInt(); @@ -210,7 +211,7 @@ bool MainWindow::InitializeUI() QGridLayout *mainLayout = new QGridLayout(centralWidget); this->setStyleSheet("background-color: white;"); - //this->setProperty("canMove",true); + this->setProperty("canMove",true); //设置窗体透明 this->setAttribute(Qt::WA_TranslucentBackground, true);