Ok, that was easier then thought:
Apparently dup2() (never heard of it..) can redirect stdout and stderr to another (file or socket)descriptor (sorry, never heard of that either... ).

Whenever the QTcpServer gets an incoming connection, a incomingConnection(int handle) is emitted. This handle can be used in order to redirect all stdout ans stderr over a newly created socket.
Qt Code:
  1. void Server::incomingConnection(int handle)
  2. {
  3. Client *client = new Client(this);
  4. client->setSocket(handle);
  5. }
To copy to clipboard, switch view to plain text mode 
In client:
Qt Code:
  1. void Client::setSocket(int descriptor)
  2. {
  3. socket = new QTcpSocket(this);
  4. socket->setSocketDescriptor(descriptor);
  5.  
  6. dup2(descriptor, 1); // stdout
  7. dup2(descriptor, 2); // stderr
  8.  
  9. qDebug() << "This text ends up at the telnet-session of the connected client";
  10.  
  11. // connect socket signals to slots
  12. connect(socket, SIGNAL(connected()), this, SLOT(socketConnected()));
  13. connect(socket, SIGNAL(readyRead()), this, SLOT(socketReadyRead()));
  14.  
  15. qDebug() << "Socket created";
  16. }
To copy to clipboard, switch view to plain text mode