Below is the code for my qthread implementation. I am trying to get gps data from satellite. QThread doesn\'t produce the finished() signal even when the programs exits
The way the QThread lifecycle works is like this:
QThread::start().isRunning() should start returning true.started() signal.run().run() calls exec().exec() enters an event loop and stays there until quit() or exit() is called.exec() and run() return to the internals.isFinished() should start returning true and isRunning() false.finished() signal.So you need to call quit() after your location fetcher is done - but this->quit() isn't calling quit() on the thread! This is probably why it's not doing anything.
Your code looks a bit like it was patterned after this article:
http://mayaposch.wordpress.com/2011/11/01/how-to-really-truly-use-qthreads-the-full-explanation/
Note how she gives her worker a finished() signal (not the same as QThread::finished) and connects it to the QThread::quit() slot.