Hi all!

I have the following code and can't figure out why I can't get the
QProcess output:

Qt Code:
  1. #include <QApplication>
  2. #include <QProcess>
  3. #include <QDebug>
  4.  
  5. int main(int argc, char **argv)
  6. {
  7. QApplication application(argc, argv);
  8.  
  9. QProcess proc;
  10.  
  11. proc.start("c:\\windows\\system32\\cmd.exe", QIODevice::ReadWrite);
  12.  
  13. if (proc.waitForStarted() == false) {
  14. qDebug() << "Error starting cmd.exe process";
  15. qDebug() << proc.errorString();
  16.  
  17. return (-1);
  18. }
  19.  
  20. // Show process output
  21. qDebug() << proc.readAllStandardOutput();
  22.  
  23. proc.write("dir");
  24.  
  25. qDebug() << proc.readAllStandardOutput();
  26.  
  27. proc.close();
  28.  
  29. return 0;
  30. }
To copy to clipboard, switch view to plain text mode 

Any ideas?

Thanks!