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:
MyThread::run()
{
if (!m_qSocket.setSocketDescriptor(m_iSocketDescriptor))
{
return;
}
bool bC = connect(&m_qSocket,SIGNAL(readyRead()),this,SLOT(llegirDades()));
bool bC2 = connect(&m_qSocket,SIGNAL(disconnected()),this,SLOT(desconexio()));
exec();
//Here I need to do some work:
...
//more work, ...
...
}
MyThread::run()
{
if (!m_qSocket.setSocketDescriptor(m_iSocketDescriptor))
{
return;
}
bool bC = connect(&m_qSocket,SIGNAL(readyRead()),this,SLOT(llegirDades()));
bool bC2 = connect(&m_qSocket,SIGNAL(disconnected()),this,SLOT(desconexio()));
exec();
//Here I need to do some work:
...
//more work, ...
...
}
To copy to clipboard, switch view to plain text mode
Thanks,
Bookmarks