4

QProcess simply doesn't display the black console window.

This is the code I use:

QProcess*p=new QProcess(this);
p->start("cmd.exe");

Replacing cmd.exe with calc.exe successfully launches the calculator.

Alex
  • 34,581
  • 26
  • 91
  • 135

1 Answers1

5

Try this instead:

QProcess::startDetached("cmd.exe");
  • 1
    The following is usefull for testing commands, because it leaves the console open: `QProcess::startDetached("cmd.exe /K" + otherCommand);` – Jens A. Koch Sep 19 '14 at 13:24