QString strLogPath = QCoreApplication::applicationDirPath() + "/Log";
QProcess process(this);
process.setProgram("cmd");
QStringList argument;
argument << "/c" <<"start"<<""""<<strLogPath;//双引号必须加,例 cmd start C:\Users\Student>start "" "C:\Program Files"
process.setArguments(argument);
process.start();
process.waitForStarted(); //等待程序启动
process.waitForFinished();//等待程序关闭