diff --git a/QCPShow.pro.user b/QCPShow.pro.user index 9691761..d75d288 100644 --- a/QCPShow.pro.user +++ b/QCPShow.pro.user @@ -1,10 +1,10 @@ - + EnvironmentId - {fe03815e-74e2-457e-b60c-e66368cd4ce4} + {0d351c1e-abb6-427c-8d0b-30ca23826ed5} ProjectExplorer.Project.ActiveTarget @@ -66,7 +66,7 @@ 0 0 - E:/Qt/QtSpace/build-QcpShow-Desktop_Qt_5_8_0_MinGW_32bit-Debug + D:/Qt/QtSpace/build-QcpShow-Desktop_Qt_5_8_0_MinGW_32bit-Debug true @@ -90,7 +90,7 @@ 2 - Build + 构建 ProjectExplorer.BuildSteps.Build @@ -106,7 +106,7 @@ 1 - Clean + 清理 ProjectExplorer.BuildSteps.Clean @@ -144,7 +144,7 @@ 2 - Build + 构建 ProjectExplorer.BuildSteps.Build @@ -160,7 +160,7 @@ 1 - Clean + 清理 ProjectExplorer.BuildSteps.Clean @@ -198,7 +198,7 @@ 2 - Build + 构建 ProjectExplorer.BuildSteps.Build @@ -214,7 +214,7 @@ 1 - Clean + 清理 ProjectExplorer.BuildSteps.Clean @@ -231,7 +231,7 @@ 0 - Deploy + 部署 ProjectExplorer.BuildSteps.Deploy @@ -285,14 +285,14 @@ 2 QCPShow - - Qt4ProjectManager.Qt4RunConfiguration:E:/Qt/QtSpace/QCPShow/QCPShow.pro + QCPShow2 + Qt4ProjectManager.Qt4RunConfiguration:D:/Qt/QtSpace/qt_qcp_show/QCPShow.pro true QCPShow.pro false - E:/Qt/QtSpace/build-QcpShow-Desktop_Qt_5_8_0_MinGW_32bit-Debug + D:/Qt/QtSpace/build-QcpShow-Desktop_Qt_5_8_0_MinGW_32bit-Debug 3768 false true diff --git a/main.cpp b/main.cpp index 64ae1ad..4ee072a 100644 --- a/main.cpp +++ b/main.cpp @@ -43,8 +43,8 @@ int main(int argc, char *argv[]) QObject::connect(&w,&MainWidget::statusChanged,&httpService,&HttpService::updateStatus); QObject::connect(&w,&MainWidget::complexOneKeyStart,&httpService,&HttpService::onComplexOneKeyStart); - w.show(); - // w.showFullScreen(); +// w.show(); + w.showFullScreen(); return a.exec(); } diff --git a/mainwidget.cpp b/mainwidget.cpp index 1550075..37e0a7c 100644 --- a/mainwidget.cpp +++ b/mainwidget.cpp @@ -37,6 +37,7 @@ MainWidget::MainWidget(QWidget *parent) : m_patientIndex = 0; } updateUi(); + m_curX = 0; }); //显示连接状态 @@ -56,6 +57,7 @@ MainWidget::MainWidget(QWidget *parent) : // ui->countdownLabel->setAlignment(Qt::AlignHCenter); // ui->statusLabel->setAlignment(Qt::AlignRight); + isFenzhen = false; m_curX = 0; connect(&m_lableScrollTimer,SIGNAL(timeout()),this,SLOT(lableScrollDisplay())); m_lableScrollTimer.start(10); @@ -68,7 +70,7 @@ MainWidget::~MainWidget() void MainWidget::updateUi() { - m_curX = 0;//内容超出显示区域时,更新患者信息显示从头开始滚动 +// m_curX = 0;//内容超出显示区域时,更新患者信息显示从头开始滚动 //更新statusLabel // ui->statusLabel->setText(QString("%1 | %2") @@ -102,6 +104,7 @@ void MainWidget::updateUi() QString str = ""; if(pInfo->realCountDownInSeconds < 0){ str = ""; + isFenzhen = true; }else{ int hour,min,sec,nTotalSecs; nTotalSecs = pInfo->realCountDownInSeconds; @@ -130,7 +133,7 @@ void MainWidget::resizeEvent(QResizeEvent *event) QWidget::resizeEvent(event); //标题 - // ui->textLabel->setGeometry(0,0,this->width(),(this->height()-30)/2); +// ui->textLabel->setGeometry(0,0,this->width(),(this->height()-30)/2); ui->countdownLabel->setGeometry(0,(this->height()-30)/2,this->width(),(this->height()-30)/2); ui->LEDLabel->setGeometry(this->width()-120,this->height()-30,20,30); ui->statusLabel->setGeometry(this->width()-80,this->height()-30,20,30); @@ -138,20 +141,30 @@ void MainWidget::resizeEvent(QResizeEvent *event) void MainWidget::lableScrollDisplay() { +// qDebug()<<"m_curX = "<textLabel->text()); + m_height = ui->textLabel->height(); + if(isFenzhen){ + m_y = (this->height()-m_height)/2; + } + else{ + int m_y = 0; + } if(this->width() > m_width){ - ui->textLabel->setGeometry((this->width()-m_width)/2, 0,m_width,(this->height()-30)/2); + ui->textLabel->setGeometry((this->width()-m_width)/2, m_y,m_width,(this->height()-30)/2); } else{ m_curX ++; - ui->textLabel->setGeometry(20-m_curX,0,m_width,(this->height()-30)/2); - // qDebug()<<"move" <textLabel->setGeometry(150-m_curX*3,m_y,m_width,(this->height()-30)/2); } - if(m_curX > (m_width - this->width())){ + if(m_curX > m_width){ m_curX = 0; } - } void MainWidget::onWsConnectedStatusChanged(int status) diff --git a/mainwidget.h b/mainwidget.h index b1f6511..c119365 100644 --- a/mainwidget.h +++ b/mainwidget.h @@ -31,7 +31,8 @@ private: int m_wsConnectedStatus; QFont font1, font2, font3; QTimer m_lableScrollTimer; - int m_width, m_curX; + int m_width, m_height, m_curX, m_y; + bool isFenzhen; public slots: void updateUi();