is there a way to force the main thread to wait until all threads created from it, will finish their job, before finishing the program. I mean:
int main(){
Well, what about:
a.wait(); b.wait();
Or, you would rather start an event loop (as usually for Qt applications) that you quit when both of your threads end (QThread emits finished() and terminated() signals).