Hi, I am using using the following code to successfully collect the stout of the program I run with QProcess.

Qt Code:
  1. QProcess *Process = new QProcess;
  2. Process->start(program, args);
  3.  
  4. Process->waitForFinished();
  5.  
  6. QTextStream rsyncStdoutStream(rsyncProcess->readAllStandardOutput());
  7. while (true)
  8. {
  9. QString line = rsyncStdoutStream.readLine();
  10. if (line.isNull())
  11. break;
  12. else
  13. newFiles.append(line);
  14. }
To copy to clipboard, switch view to plain text mode 

The problem is that with this code the output is actually collected once the program is finished, so I do not have "live" access to it, which is actually what I am looking for (I would need this for other purpose). Simply not using the waitForFinished() function makes my program to crash.

i thought that using the QProcess::readyReadStandardOutput signal could be a solution, but AFAIK this would need to call a SLOT and with this it is not possible to return any value, which is my need. So I am a bit stuck at this point..

Thanks,
Jan