Hi,

Can a QThread call "exec()" on "run()" method and then do some work or "exec()" locks?

I need to call "exec()" because the Thread have a Socket so the events have to be sended to this Thread, but also have to do som work:

Qt Code:
  1. MyThread::run()
  2. {
  3. if (!m_qSocket.setSocketDescriptor(m_iSocketDescriptor))
  4. {
  5. return;
  6. }
  7. bool bC = connect(&m_qSocket,SIGNAL(readyRead()),this,SLOT(llegirDades()));
  8. bool bC2 = connect(&m_qSocket,SIGNAL(disconnected()),this,SLOT(desconexio()));
  9. exec();
  10. //Here I need to do some work:
  11. ...
  12. //more work, ...
  13. ...
  14. }
To copy to clipboard, switch view to plain text mode 

Thanks,