分离已启动的过程 [英] Detaching a started process
问题描述
我已经使用 QProcess :: start()
启动了一个过程,然后需要将其分离.我该怎么做?我尚未在Qt文档中找到相关信息.
I've started a process using QProcess::start()
and I need to detach it afterwards. How can I do it? I haven't found relevant info in the Qt docs.
我知道 QProcess :: startDetached()
,但是由于程序中的其他代码,我无法使用它(我需要将进程的开始和分离分开).
I'm aware of QProcess::startDetached()
, but due to other code in the program, I can't use it (I need to separate the starting and the detaching of the process).
推荐答案
You can't as of 5.1, see here. There's also a suggestion in the comments, not sure if useful for your case):
解决方法建议:编写一个帮助程序进程,该进程启动分离的进程,并在所有设置完成后终止.
Workaround proposal: write a helper process that starts detached processes, and terminates itself when all setting up is completed.
这篇关于分离已启动的过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!