Getting socket thread gives QObject(0x0).... / cant moveToThread()
Solved
General and Desktop
-
Hey
I'm trying to deal with my sockets somehow... how do I test for this > QTcpSocket->thread() == QObject(0x0) ?
I've got this and I dunno how to test against it o.O I expected either nullptr or ptr to thread, not that thing...
Tips?
This is my problem >
QObject::moveToThread: Current thread (0x1447ae1e180) is not the object's thread (0x0). Cannot move to target thread (0x1447ae3ff70)
TIA.
-
@Dariusz said in Getting socket thread gives QObject(0x0).... / cant moveToThread():
Tips?
I cannot really understand what you want to do, and also what your main problem is!
If you want to check if a QTcpSocket runs in current thread, the right test is:
QThread::currentThread() == socket->thread()
-
This post is deleted!