Quantcast
Channel: QtWebEngine
Viewing all articles
Browse latest Browse all 13965

QThread, signals and slots

$
0
0
Hi, I have a doubt regarding qThread. void Worker::run() {     qWarning()<<"Thread Started";       tcpServerConnection=new QTcpSocket();     qWarning()<<"SOCKET ID"<<socketDescriptor;         if(!tcpServerConnection->setSocketDescriptor(socketDescriptor))     {              qWarning()<<"ERROR IN SOCKETDESCRIPTOR ";                 // something's wrong, we just emit a signal            emit error(tcpServerConnection->error());     }       connect(tcpServerConnection, SIGNAL(readyRead()), this, SLOT(readyRead()),Qt::DirectConnection);     connect(tcpServerConnection, SIGNAL(disconnected()), this, SLOT(disconnected()));     qDebug() << socketDescriptor << " Client connected";       qWarning()<<"SOCKET DESCRIPTOR in worker"<< tcpServerConnection->socketDescriptor();     exec();   } this is the code of a QThread::run(). I need to know in these connect statements the slots are executed, is these slots are executing in threads context or with the main thread?

Viewing all articles
Browse latest Browse all 13965

Trending Articles