Hi,
I am trying to run a class's void function called "show()", here is code:

in main.cpp
Qt Code:
  1. MyClassObj* cObj;
  2. QThread thread;
  3.  
  4.  
  5. for (int i=0 ; i<=vecObj.count() ; i++)
  6. {
  7. cObj=&vecObj[i][0];
  8. cObj->moveToThread(&thread);
  9.  
  10.  
  11. cObj->connect(&thread,SIGNAL(started()),SLOT(show()));
  12. thread.connect(&thread,SIGNAL(finished()),&thread,SLOT(quit()));
  13.  
  14.  
  15. thread.start();
  16. thread.wait();
  17.  
  18.  
  19. }
To copy to clipboard, switch view to plain text mode 

now issue is, this code runs fine for the first loop, but since thread.wait() is called at the end of loop, thread waits for execution to stop (waiting for thread.quit()) after first loop and i am not able "resume" this wait() condition so that show() is called again for next loop.

I am kinda stuck here, i have been going through many articles and forum discussion, haven't found any issue like this.

Any help will be greatfully appreciated.
Thanks in advance.