Restart QProcess
-
Hi,
I need to launch a number of external programs from QT application and monitor their state, in case of crashing program need to be restarted. (Linux platform only)
So I found QProcess most useful for this, but have a problem - when I get onError signal from QProcess instance, I can't re-run it with the same parameters, as process still in QProcess::Running state.I will be very thankful for any advice regarding QProcess re-run thick or may be any more useful way to manage processes
-
[quote author="mcosta" date="1364211388"]Hi,
once you received error signal with Crashed value, you can call kill() and then re-run it
[/quote]It's not work.
Even after kill() or terminate() QProcess state equals to QProcess::Running and trying to
call start() will give you:
QProcess::start: Process is already runningI don't know, may be I'm using QProcess wrong, but it looks like a bug. Sending SIGTERM or SIGINT to external process raise only onError() signal, but state of QProcess leaves as running.
I tried to extend QProcess with my own class and set NotRunning state manually(I know thats not correct, just for test), but QProcess also give me warning message.