I have a function A()
in which I execute eight other 'sub-functions' which all include a QProcess
. How do I get the return codes from all the QProcesses?
Example:
void Mainclass::A()
{
B();
C();
// ...
I();
}
void Mainclass::B()
{
QString CommandPath = "PathB";
QProcess *Process = new QProcess(this);
Process->setWorkingDirectory(MainDir);
Process->setStandardOutputFile(MainDir + "/geometries");
Process->start(CommandPath);
Process->waitForFinished();
QProcess::ExitStatus Status = Process->exitStatus();
if (Status == 0)
{
std::cout << "App executed!" << std::endl;
}
}
I found this example but don't understand how to implement it myself because I use pointer objects in my application.
Maybe int QProcess::exitCode () const
? See.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With