Thank you!

I wrote it:
Qt Code:
  1. void ServerThread::run()
  2. {
  3. socket = new QTcpSocket;
  4. ....
  5. }
To copy to clipboard, switch view to plain text mode 

You do not need threads in this example.
I will have the many clients.

Output:

QObject: Cannot create children for a parent that is in a different thread.
(Parent is QThread(0x547258), parent's thread is QThread(0x5416a8), current thre
ad is QThread(0x547258)
Object::connect: No such slot QThread::sendData() in ../ServerTimer/serverthread
.cpp:20