Hi,

I have this problem:

-One thread is continously doing some work and when it finish one loop, it emits a signal to own class in the main thread.
-The main thread has the own class that takes the signal and the properly slot is called. It uses a QQueue and enqueue this message.
-This own class is a QThread and has a QTcpSocket. In "run" method, it asks the QQueue if there is a message to send, and if there is one, it sends using the socket.
-This own class has the "readyRead" signal connected to a slot (in the thread).

This works ok if only doing this, but I'm getting "QSocketNotifier: socket notifiers cannot be disabled from another thread". I have readed that this is not a good solution.

I modified the own class to not inherit from QThread and the QSocketNotifier error has gone. Now the own class enqueue the message and sends the message(the message is enqueued because the response message have to be compared with the sended message).

But I have more things:

-In the main thread there is a QTimer that every 5 seconds tells the onw class to send a message, so it enqueue it and send it.
-Then, when the "readyRead" signal is emited that calls the slot "readFromSocket", I read the corresponding bytes, dequeue the first sended message and compare them.

It is like one thread create a quesion and the timer another one(different). By this I use a QQueue. Note that my class is not a Thread now.

But this is not working as expected.

Anyone knows how to do this?

Thanks,