4

How can I suspend and resume a subprocess that I started as a QProcess in Qt? Is there a Qt function for that, or if not, a platform-specific one that would work on Linux?

sashoalm
  • 75,001
  • 122
  • 434
  • 781

1 Answers1

4

Since I'm on linux, I used the kill() function.

#include <signal.h>
...
kill(process->pid(), SIGSTOP); // suspend
kill(process->pid(), SIGCONT); // resume
Chris
  • 3,245
  • 4
  • 29
  • 53
sashoalm
  • 75,001
  • 122
  • 434
  • 781
  • 1
    Works perfectly... I'm using C++ Qt QProcess and this works like a charm in pausing and resuming a process... – Maxx Sep 04 '16 at 15:26