|
|
@ -99,13 +99,18 @@ void MainWidget::updateUi() |
|
|
|
ui->textLabel->setText(pInfo->text); |
|
|
|
|
|
|
|
//显示倒计时
|
|
|
|
QString str = ""; |
|
|
|
if(pInfo->realCountDownInSeconds < 0){ |
|
|
|
str = ""; |
|
|
|
}else{ |
|
|
|
int hour,min,sec,nTotalSecs; |
|
|
|
nTotalSecs = pInfo->realCountDownInSeconds; |
|
|
|
sec = nTotalSecs % 60; |
|
|
|
// min = nTotalSecs / 60 % 60;
|
|
|
|
min = nTotalSecs / 60 ; //min显示大于60
|
|
|
|
hour = nTotalSecs / 3600; |
|
|
|
QString str = QString("%1:%2").arg(min,2,10,QLatin1Char('0')).arg(sec,2,10,QLatin1Char('0')); |
|
|
|
str = QString("%1:%2").arg(min,2,10,QLatin1Char('0')).arg(sec,2,10,QLatin1Char('0')); |
|
|
|
} |
|
|
|
ui->countdownLabel->setText(str); |
|
|
|
} |
|
|
|
|
|
|
@ -156,7 +161,7 @@ void MainWidget::onWsConnectedStatusChanged(int status) |
|
|
|
updateUi(); |
|
|
|
} |
|
|
|
|
|
|
|
void MainWidget::onNewPatientMergencyInfo(QString firstAidId, QString name, QString content, quint64 realCountDownInSeconds) |
|
|
|
void MainWidget::onNewPatientMergencyInfo(QString firstAidId, QString name, QString content, qint64 realCountDownInSeconds) |
|
|
|
{ |
|
|
|
//TODO 此处是否需要加锁处理
|
|
|
|
PatientEmergencyInfo *pInfo = new PatientEmergencyInfo(firstAidId,name,content,realCountDownInSeconds); |
|
|
|