Reputation: 861
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.
Upvotes: 4
Views: 8128