Quote Originally Posted by munna
Yes this is the real code. I comiples and works, but not as expected.
That's quite interesting. What compiler do you use? Can you compile this program with it?
Qt Code:
  1. class Test
  2. {
  3. public:
  4. Test() {};
  5. void foo() {};
  6. };
  7.  
  8. int main()
  9. {
  10. Test t();
  11. t.foo();
  12. return 0;
  13. }
To copy to clipboard, switch view to plain text mode 

Quote Originally Posted by munna
I am new to all this. can you please explain this in more detail or some tutorial.
Everything you need is in the docs --- just read them carefully. Also check the network/http example.

Your MyThread::run() should look like this:
Qt Code:
  1. void MyThread::run()
  2. {
  3. HttpLogger logger;
  4. connect( &logger, SIGNAL( finished() ), this, SLOT( quit() ) );
  5. logger.start();
  6. exec();
  7. }
To copy to clipboard, switch view to plain text mode 
The rest should be handled by signals & slots of the logger object (or whatever you will call it). HttpLogger::start() should start the timer and after given interval that object should emit finished() signal to stop the thread.