Try doing it the proper way -- connect the readyReadStandardOutput() signal from your process to a slot and read the data there, and don't read a single line, but rather all of them at once.

Qt Code:
  1. QProcess *process = new QProcess(...);
  2. connect(process, SIGNAL(readyReadStandardOutput ()), this, SLOT(fetchOutput()));
  3. connect(process, SIGNAL(finished ( int, QProcess::ExitStatus )), this, SLOT(fetchRest()));
  4. process->start("...");
  5. //...
  6.  
  7. void thisClass::fetchOutput(){
  8. QProcess *proc = (QProcess*)sender();
  9. while(proc->canReadLine()){
  10. cout << proc->readLine().constData() << endl;
  11. }
  12. }
  13.  
  14. void thisClass::fetchRest(){
  15. QProcess *proc = (QProcess*)sender();
  16. cout << proc->readAllStandardOutput().constData();
  17. }
To copy to clipboard, switch view to plain text mode