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);