You should not initialize your QDataStream with QTcpSocket.
You should read the data from the socket io device with
QByteArray QIODevice::readAll()
.You should write the byte array of the previous operation into the data stream with the "<<" operator.
So, the code should look something like this:
void FortuneThread::readCommand()
{
QByteArray block;
QDataStream out(&block, QIODevice::WriteOnly);
out << tcpSocketPtr->readAll();
...
}