QProcess and shell : Destroyed while process is still running

前端 未结 2 934
忘掉有多难
忘掉有多难 2020-12-19 10:31

I want to launch a shell script with Qt.

QProcess process;
process.start(commandLine, QStringList() << confFile);
process.waitForFinished();

if(proces         


        
2条回答
  •  佛祖请我去吃肉
    2020-12-19 10:45

    process.waitForFinished(); is hitting the default 30 seconds timeout. Use process.waitForFinished(-1); instead. This will make sure you wait for however long it takes for the process to finish, without any timeout.

提交回复
热议问题