有沒有辦法強制主線程等到所有線程創建完畢後才能完成程序。我的意思是:使主線程等待,直到所有其他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