QProcess* process = new QProcess(this);
    process->start("E:/bin/Release/temp/test.exe");   //无法启动
    QString path = "E:/bin/Release/temp/test.exe";
    process->start(path);   //无法启动
    process->startDetached(path);   //可以启动
    QProcess::startDetached(path, QStringList(path));   //可以启动

    //当程序路径中含有空格的时候,仅设置程序路径program是无法启动的。还需将程序路径传递给参数arguments。
    QString path = "E:/bin/Release/temp/test v1_0_0.exe";
    process->start(path);   //无法启动
    process->startDetached(path);   //无法启动
    process->startDetached(path, QStringList(path));   //可以启动
    QProcess::startDetached(path, QStringList(path));   //可以启动


    process->setProgram("E:/bin/Release/temp/test.exe");
    process->setArguments(QStringList("E:/bin/Release/temp/test.exe"));
    process->start();   //无法启动

貌似start都不能启动,很奇怪。。。

 

更多知识:https://www.cnblogs.com/mengfanrong/p/5341512.html

相关文章:

  • 2021-10-19
  • 2021-08-01
  • 2021-09-14
  • 2022-01-01
  • 2021-12-06
  • 2021-06-18
  • 2021-11-18
  • 2021-07-30
猜你喜欢
  • 2021-11-23
  • 2021-09-14
  • 2021-11-09
  • 2021-11-09
  • 2021-09-17
  • 2021-12-07
  • 2021-10-28
  • 2021-10-08
相关资源
相似解决方案