有没有办法强制主线程等到所有线程创建完毕后才能完成程序。我的意思是:使主线程等待,直到所有其他Qthread完成
int main(){
QthreadClass a; // in cons' a thread is created and running
QthreadClass b; // same as before
*** wish to wait till both created thread finished their jobs ***
return 0;
}
+1,当你打我的时候,我正在写这篇文章。 [这是关于QThread :: wait]的文档(http://qt-project.org/doc/qt-4.8/qthread.html#wait) – tmpearce 2013-03-10 15:52:09
@tmpearce对不起,关于:)对,Qt文档是最好的地方先看看。 – Archie 2013-03-10 15:53:59