QProcess Try Catch
Solved
General and Desktop
-
I wanted use Try Catch for QProcess but dont working.
try {
QProcess *process = new QProcess(this);
QString program = "myapp.exe";
process->start(program);
} catch (QProcess::ProcessError error) {
qDebug() << error << " exe not found";
}Why not working ? What i need use?
-
Hi,
Because Qt doesn't throw exceptions.
Use signals and slots, or the waitForXXX methods and the error method to get the information you want.
-
Did you read QProcess documentation ?
You already have there several examples.
As for signals and slots, you have a dedicated chapter here.