修改线程的退出,修改ins2 time显示到界面

This commit is contained in:
hm
2020-12-14 11:09:41 +08:00
parent daf8e618bb
commit 543dd019f9
10 changed files with 368 additions and 346 deletions
+6 -2
View File
@@ -45,7 +45,11 @@ void commandprocess::stop()
if(thread->isRunning())
{
running_flag = false;
qDebug() << "thread stop" << running_flag;
qDebug() << "thread stop"
<< QThread::currentThreadId()
<< QThread::currentThread()
<< "running state:"
<< running_flag;
}
else
{
@@ -73,7 +77,7 @@ void commandprocess::process()//线程函数
}
//退出线程
thread->quit();
thread->wait(200);//等待结束
//thread->wait(200);//等待结束
thread->deleteLater();
thread = nullptr;
}