众所周知QProcess类的作用是启动一个外部的程序并与之交互它有三种方式调用外部程序: 1. execute 2. start 3. startDetached 从调用上看: execute是阻塞调用, 并且继承了调用者环境变量和工作目录(The environment and working directory are inherited from the calling process.) start则是异步调用,而非阻塞调用. startDetached呢则是运行外部程序并且脱离调用程序
主动宣告setProcessState(QProcess::NotRunning) 或者在堆上new一个QProcess. 出处: https://stackoverflow.com/questions/33874243/qprocessstartdetached-but-hide-console-window I had exactly the same problem, and could not solve it in a clean way. I have found 2