I have 2 threads which each create a new QTcpSocket
in the run method()
.
I connect the two threads together widh a signal/slot like:
connect(thread1, SIGNAL(foo()), thread2, SLOT(bar()));
But when I want to use the socket from thread2 in bar slot I keep getting this error message:
"QSocketNotifier: Socket notifiers cannot be enabled or disabled from another thread"
Additional info:
- thread1 and thread2 are both objects of the same class.
- I used qDebug to check if the socket from bar slot is really the socket from thread2 (it is).
I want to know if anyone knows what am I doing wrong and why.
Thank you, qwerty