[Interest] QProcess overload slot connection

Jason H jhihn at gmx.com
Thu Mar 14 15:04:53 CET 2019



> > Because the NotRunning will occur always, and immediately, and finished
> > won't. Failed command:
> > stateCanged QProcess::Starting
> > stateCanged QProcess::NotRunning
> > // no finished!
> 
> Good catch. A process that didn't start can't finish.
> 
> Another way would be to waitForStarted() before entering the loop. Unlike the 
> other waitFor functions, waitForStarted can be relied upon to finish rather 
> quickly, since it only depends on the current thread anyway. If it takes long, 
> then it's because the entire system is swapping hard and taking time to do 
> everything.

>From an API perspective, I think most people, when connecting to QProcess::finished, are really looking for a way to do NotRunning, but there is not a signal for this.

perhaps adding a QProcess::notRunning signal is in order? Or at least some clarification in the docs?



More information about the Interest mailing list