(sorry for my english)
I have the same problem .. signal is not emitted ...i know that i need to add a event loop to the app but i don't know where and how ..

My app is a producer/consumer problem that i solve with WaitConditions and a Circular Buffer.. So i have a main Thread and two sub-threads Producer and Consumer
i the code the Producer emit a signal that i need to use to update some information to show.

This is a console app.

Some snippet of the code:

ProducerThread
Qt Code:
  1. ProcessingThread::ProcessingThread(FrameBuffer *imageBuffer, double inputSourceWidth, double inputSourceHeight,QObject *parent) :QThread(parent){
  2. this->buffer = imageBuffer;
  3. this->stopped = false;
  4. }
  5.  
  6.  
  7. void ProcessingThread::run(){
  8.  
  9. while(1){
  10. // Stop thread if stopped=TRUE //
  11. stoppedMutex.lock();
  12. if (stopped)
  13. {
  14. stopped=false;
  15. stoppedMutex.unlock();
  16. break;
  17. }
  18. stoppedMutex.unlock();
  19. // Get frame from queue
  20. this->currentFrame = buffer->getFrame();
  21. if(this->currentFrame.empty()==false){
  22. //Do the heavy work
  23. emit newFrame();
  24. }else{
  25. qDebug()<<"Se recibio un frame NULL";
  26. }
  27. }
  28.  
  29. qDebug()<<"Deteniendo el procesado";
  30. }
To copy to clipboard, switch view to plain text mode 

The ConsumerThread
Qt Code:
  1. ConsumerThread::ConsumerThread(FrameBuffer *buffer, int deviceNumber):QThread(), imageBuffer(buffer){
  2. // Open camera
  3. capture = VideoCapture(deviceNumber);
  4. // Initialize variables
  5. stopped=false;
  6. }
  7.  
  8. void ConsumerThread::run()
  9. {
  10. while(1)
  11. {
  12. /////////////////////////////////
  13. // Stop thread if stopped=TRUE //
  14. /////////////////////////////////
  15. stoppedMutex.lock();
  16. if (stopped)
  17. {
  18. stopped=false;
  19. stoppedMutex.unlock();
  20. break;
  21. }
  22. stoppedMutex.unlock();
  23. /////////////////////////////////
  24. /////////////////////////////////
  25.  
  26. // Capture and add frame to buffer
  27. //....
  28. //....
  29.  
  30. }
  31. qDebug() << "Stopping capture thread...";
  32. } // run()
To copy to clipboard, switch view to plain text mode 

So i have a Controller class to get access to this threads
and i Show class to execute this using the controller
The Show class:
Qt Code:
  1. Show::Show(QObject *parent) :QObject(parent){
  2. qDebug()<<"Iniciando..";
  3. controlador = new Controlador(3,3,0);
  4. }
  5.  
  6. void Show::start(){
  7. qDebug()<"Start";
  8. if(controlador->isCameraConnected()){
  9. connect(controlador->processing,SIGNAL(newFrame()),this,SLOT(updateFrame()),Qt::QueuedConnection);
  10. controlador->capture->start();
  11. controlador->processing->start();
  12. controlador->capture->wait();
  13. controlador->processing->wait();
  14. controlador->disconnectCamera();
  15. }
  16. }
  17.  
  18. void Show::updateFrame(){
  19. qDebug()<<"Update Frame";
  20. }
To copy to clipboard, switch view to plain text mode 


But the signal newFrame or is never emitted or the slot updataFrame don't receive the signal..

any idea???