Do I get a finished slot if I start QProcess using startDetached

本小妞迷上赌 提交于 2019-12-17 14:52:37

问题


Do I get a finished signal if I start a QProcess using startDetached()? I'm trying to start a process, but I need to be able to get an event when the process has terminated.


回答1:


No you can't get a signal when you use startDetached because you have no object.

startDetached is a static function and when you call it the process is started directly without creating a QProcess object. Therefore, even if there was a signal you would not be able to connect it to anything since you have no object to connect from.

If you want a signal you should create a QProcess object and then call start on it. You will then be able to get the finished signal when the process finishes.



来源:https://stackoverflow.com/questions/298060/do-i-get-a-finished-slot-if-i-start-qprocess-using-startdetached

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!