This bug is easy to replicate and it’s been present for a long time. In fact, this bug report was sent in 2013 and still waits to be fixed.
If you have a QProcess and you use the
QProcess::stateChanged signal to check when the process goes down, do not try to restart the process in the slot attached to the signal because the QProcess state will get stuck in
QProcess::Starting and it won’t work.
Instead, restart your process in a slot connected to the
QProcess::finished signal, or use
QTimer::singleShot within the handler of
stateChanged to enqueue the process restart instead of doing it immediately.