我用qt做了一个采集视频的 想把时间实时显示到视频上怎么实现??求大神指点
1个回答
展开全部
void ClockWindow::timerEvent(QTimerEvent *event){ QDateTime qdatetime=QDateTime::currentDateTime(); int y=qdatetime.date().year(); int m=qdatetime.date().month(); int d=qdatetime.date().day(); QString strTime=qdatetime.time().toString(); QLabel *TextLabel_Time = new QLabel(this); TextLabel_Time->setText(strTime+"
"+QString::number(d)+"/"+QString::number(m)+"/"+QString::number(y));
/余困/显肢芦示时间格式历毁带为21:09:54 9/4/2009 QTimer *time = new QTime(TextLabel_Time); QTimer *timec = new QTime(TextLabel_Time) connect(time,SIGNAL(timeout()),TextLabel_Time,SLoT(show())); connect(timec,SIGNAL(timeout()),TextLabel_Time,SLoT(clear())); time->start(1000); timec->start(2000);
"+QString::number(d)+"/"+QString::number(m)+"/"+QString::number(y));
/余困/显肢芦示时间格式历毁带为21:09:54 9/4/2009 QTimer *time = new QTime(TextLabel_Time); QTimer *timec = new QTime(TextLabel_Time) connect(time,SIGNAL(timeout()),TextLabel_Time,SLoT(show())); connect(timec,SIGNAL(timeout()),TextLabel_Time,SLoT(clear())); time->start(1000); timec->start(2000);
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询