From 54941e310b18b8396c489179b09cff09c08a6c66 Mon Sep 17 00:00:00 2001 From: Bai Date: Tue, 19 Oct 2021 18:48:14 +0800 Subject: [PATCH] =?UTF-8?q?m=5Fwsconnectedstatus=E8=B5=8B=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mainwidget.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mainwidget.cpp b/mainwidget.cpp index 7885384..3acfebd 100644 --- a/mainwidget.cpp +++ b/mainwidget.cpp @@ -25,7 +25,7 @@ MainWidget::MainWidget(QWidget *parent) : }); //切换病人 - m_switchPatientTimer.setInterval(5000); + m_switchPatientTimer.setInterval(m_switchPatientInterval * 1000); m_switchPatientTimer.start(); connect(&m_switchPatientTimer, &QTimer::timeout,[=](){ if(++m_patientIndex >= m_patientEmergencyInfos.length()){ @@ -45,8 +45,9 @@ MainWidget::~MainWidget() void MainWidget::updateUi() { + //更新statusLabel ui->statusLabel->setText(QString("%1 | %2") - .arg(m_wsConnectedStatus == 0 ? "未连接" : "已经连") + .arg(m_wsConnectedStatus == 0 ? "未连接" : "已连接") .arg(m_patientEmergencyInfos.length()) ); @@ -79,6 +80,7 @@ void MainWidget::updateUi() void MainWidget::onWsConnectedStatusChanged(int status) { qDebug() << "MainWidget::onWsConnectedStatusChanged " << status; + m_wsConnectedStatus = status; updateUi(); }