Hey there,

I've implemented a QThread.

Here is my run function:

Qt Code:
  1. void qkReceptor::run()
  2. {
  3. // A timer to avoid high CPU charge
  4. QTimer timer;
  5.  
  6. connect(&timer, SIGNAL(timeout()), this, SLOT(onCheckStdin()), Qt::DirectConnection);
  7. connect(this, SIGNAL(newLine(QString)), this, SLOT(onNewLine(QString)), Qt::BlockingQueuedConnection);
  8.  
  9. timer.start(100);
  10.  
  11. QThread::exec();
  12. }
To copy to clipboard, switch view to plain text mode 

Here is my stop function:

Qt Code:
  1. void qkReceptor::stop()
  2. {
  3. QThread::quit();
  4. QThread::wait(); // Infinite loop here
  5. }
To copy to clipboard, switch view to plain text mode 

When calling stop from my main thread, wait blocks everything.
Why?

Thanks.