简体   繁体   English

暂停和恢复 Qt 中由 QProcess 启动的子进程

[英]Suspend and resume a sub-process started by QProcess in Qt

How can I suspend and resume a subprocess that I started as a QProcess in Qt?如何暂停和恢复我在 Qt 中作为 QProcess 启动的子进程? Is there a Qt function for that, or if not, a platform-specific one that would work on Linux?是否有一个 Qt 函数,或者如果没有,一个可以在 Linux 上运行的特定于平台的函数?

Since I'm on linux, I used the kill() function.因为我在 linux 上,所以我使用了kill()函数。

#include <signal.h>
...
kill(process->pid(), SIGSTOP); // suspend
kill(process->pid(), SIGCONT); // resume

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM