You are doing it wrong.
Try something like this:

Qt Code:
  1. MainWindow::MainWindow(QWidget *parent, Qt::WFlags flags)
  2. : QMainWindow(parent, flags)
  3. {
  4. process = new QProcess(this); // create on the heap, so it doesn't go out of scope
  5. connect (process, SIGNAL(readyReadStandardOutput()), this, SLOT(processOutput())); // connect process signals with your code
  6. connect (process, SIGNAL(readyReadStandardError()), this, SLOT(processOutput())); // same here
  7. process->start(program, args); // start the process
  8. }
  9.  
  10.  
  11. // this gets called whenever the process has something to say...
  12. void MainWindow::processOutput()
  13. {
  14. qDebug() << process->readAllStandardOutput(); // read normal output
  15. qDebug() << process->readAllStandardError(); // read error channel
  16. }
To copy to clipboard, switch view to plain text mode 

Success