在mainwindow.cpp中,成功调用了cmd.exe文件,用"del result.txt\n\r"可以删除E:\\mycodeofjava下的result.txt\文件。
接着运行下一行"java -Dfile.encoding=utf-8 -jar Translate1.0.2.jar\n\r"程序就卡死了,请问这是什么原因
void MainWindow::on_pushButton_2_clicked()
{
QProcess process(this);
process.setWorkingDirectory("E:\\mycodeofjava");
process.start("cmd.exe");
//process.write ("del result.txt\n\r");
process.write ("java -Dfile.encoding=utf-8 -jar Translate1.0.2.jar\n\r");
//QString strResult = QString::fromLocal8Bit(process.readAllStandardOutput());
//ui->lineEdit->setText(strResult);
//process.write ("exit\n\r");
process.waitForFinished();
process.close();
}