Well I did the following:
I created a timer in the Constructor of my ClientSocket:
connect(timer, SIGNAL(timeout()), this, SLOT(displayThreadID()));
timer->start(500);
QTimer *timer = new QTimer(this);
connect(timer, SIGNAL(timeout()), this, SLOT(displayThreadID()));
timer->start(500);
To copy to clipboard, switch view to plain text mode
void ClientSocket::displayThreadID()
{
qDebug
() <<
QThread::currentThreadId;
}
void ClientSocket::displayThreadID()
{
qDebug() << QThread::currentThreadId;
}
To copy to clipboard, switch view to plain text mode
The ID isn't different from the ID in the main Thread, before creating the Thread for the socket.
At the moment my applications starts crashing sometimes because of thread errors...
Bookmarks