I have the following function:

Qt Code:
  1. void Rsh::receiveMessage() {
  2.  
  3. QString responseLine;
  4. QString response;
  5.  
  6. QTextStream in(tcpSocket);
  7.  
  8. if( !tcpSocket->canReadLine() )
  9. {
  10. return;
  11. }
  12.  
  13. while( tcpSocket->canReadLine() ){
  14. responseLine = tcpSocket->readLine();
  15. response.append(responseLine);
  16. }
  17. ui.ResultsTextEdit->append(tr("%1").arg(response));
  18. }
To copy to clipboard, switch view to plain text mode 

This works to pull data from the connection, however the first complete line of text is always missing...

any ideas?