Problem solved:

I was starting the thread in another class. So, I change it to be run from the constructor in the thread.

Qt Code:
  1. Client :: Client(int socketDescriptor, Server *server, QObject *parent) : QThread(parent)
  2. {
  3. this->socketDescriptor = socketDescriptor;
  4. this->server = server;
  5. this->message = new Message(this);
  6. chattingUserName = new QString();
  7. messageIn = new QByteArray();
  8. clientLogged = false;
  9. connect(this, SIGNAL(finished()), this, SLOT(finished()));
  10. run();
  11. }
To copy to clipboard, switch view to plain text mode