In main loop there's GUI processing. In second thread - created inside QMainWindow constructor - I want to process data.
In specific point of time, in one of function in data thread - I want to display current process state and wait till user presses button (or timer expire - whatever). So I found QWaitCondition and QMutex which should do the job, but they only freeze program.

In data thread
Qt Code:
  1. extern QWaitCondition robotNextMoveWait;
  2. extern QMutex robotNextMoveWaitMutex;
  3. ...
  4. robotNextMoveWaitMutex.lock();
  5. emit robotBeforeMove(&currentScanResult);
  6. robotNextMoveWait.wait(&robotNextMoveWaitMutex);
  7. robotNextMoveWaitMutex.unlock();
To copy to clipboard, switch view to plain text mode 
this signal is transmitted through series of object Robot->enviroment->experiment->DataThread to second thread MainWindow->Dialog

in Gui Thread
Qt Code:
  1. QWaitCondition robotNextMoveWait;
  2. QMutex robotNextMoveWaitMutex;
  3. ...
To copy to clipboard, switch view to plain text mode 

In debug session I placed in all object in data thread slots with break point to watch how signal is processed. And it arrives to Experiment, but not to DataThread. Something strange.
Connections in DataThread is set like this
Qt Code:
  1. void CDataThread::run()
  2. {
  3. m_ptrExperiment = new CExperiment;
  4. bool bResult;
  5. bResult = connect(m_ptrExperiment,SIGNAL(robotBeforeMove(CScanResults *)),SLOT(onRobotBeforeMove(CScanResults *)));
  6. Q_ASSERT_X(bResult==true,"CDataThread::run","Connect 'm_stExperiment:robotBeforeMove ' with 'this:onRobotBeforeMove'");
  7. //bResult = connect(m_ptrExperiment,SIGNAL(robotBeforeMove(CScanResults *)),SIGNAL(robotBeforeMove(CScanResults *)));
  8. //Q_ASSERT_X(bResult==true,"CDataThread::run","Connect 'm_stExperiment:robotBeforeMove ' with signal 'this:robotBeforeMove'");
  9. exec();
  10. }
To copy to clipboard, switch view to plain text mode 

Where did I make error? Could some one show me better solution? This is my second contact with threads.