Qt Execute external program

前端 未结 4 829
感动是毒
感动是毒 2020-12-08 19:53

I want to start an external program out of my QT-Programm. The only working solution was:

system(\"start explorer.exe\");

But it is only wo

4条回答
  •  被撕碎了的回忆
    2020-12-08 20:33

    Just use QProcess::startDetached; it's static and you don't need to worry about waiting for it to finish or allocating things on the heap or anything like that:

    QProcess::startDetached(QDir::homepath + "/file.exe");
    

    It's the detached counterpart to QProcess::execute.

提交回复
热议问题