
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?
class Test
{
public:
Test() {};
void foo() {};
};
int main()
{
Test t();
t.foo();
return 0;
}
class Test
{
public:
Test() {};
void foo() {};
};
int main()
{
Test t();
t.foo();
return 0;
}
To copy to clipboard, switch view to plain text mode

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:
void MyThread::run()
{
HttpLogger logger;
connect( &logger, SIGNAL( finished() ), this, SLOT( quit() ) );
logger.start();
exec();
}
void MyThread::run()
{
HttpLogger logger;
connect( &logger, SIGNAL( finished() ), this, SLOT( quit() ) );
logger.start();
exec();
}
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.
Bookmarks