I am using 2 threads: GUI thread and 1 worker thread(grabthread),but i am not able to run them concurrently.
My main() function is like this :
Qt Code:
  1. int main(int argc, char *argv[])
  2. {
  3. QApplication a(argc, argv);
  4. MainWindow win;
  5. win.show();
  6. GrabThread thread;
  7. thread.start();
  8. qDebug() << "hello from GUI thread " << a.thread()->currentThreadId();
  9. thread.wait(); // do not exit before the thread is completed!
  10. return a.exec();
  11. }
To copy to clipboard, switch view to plain text mode 

and grabthread.h like this:
Qt Code:
  1. class GrabThread : public QThread
  2. {
  3. Q_OBJECT
  4. private:
  5. void run();
  6. };
To copy to clipboard, switch view to plain text mode 

What is happening is that My GUI pops up only after grabthread has been fully executed and exits.
I want my GUI and grabthread to start simultaneously so that i can use multithreading.