> > What's the "right way" to connect QProcess::finished to QEventLoop::quit?
> 
> The one you listed above.

It turns out that I'm not even using that anymore. 

In the situation that there's a problem, you end up waiting for timeout.
So:
connect(process,QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished), 
&loop, &QEventLoop::quit);
becomes:
connect(process, &QProcess::stateChanged,[=, &loop](QProcess::ProcessState 
state) {
        qDebug() << "stateCanged" << state;
        if (state == QProcess::ProcessState::NotRunning) loop.quit();
});

Because the NotRunning will occur always, and immediately, and finished won't.
Failed command:
stateCanged QProcess::Starting
stateCanged QProcess::NotRunning
// no finished!

Successful command:
stateCanged QProcess::Starting
stateCanged QProcess::Running
stateCanged QProcess::NotRunning
finished 0 QProcess::NormalExit

_______________________________________________
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest

Reply via email to