
Originally Posted by
hind
Yes, I do have a way to start the process and receive the output by using other functions of QProcessor. But then I will have to analyze the output myself. As the command "ping" has complex output strings and the program would run on systems of different languages, I need to find a easier way to get the result, and that is why I don't use scripts. The STATIC function QProcess::execute() has a return value, which avoids analyzing result of ping, but I seem losing control of the output at the same time. If there's a way to control the behaviour of the static function I would like to know.
You don't have to analyze anything.
process.
start("ping",
QStringList() << IP <<
"-n" <<
"1" <<
"-w" <<
"50");
process.waitForFinished();
int exitCode = process.exitCode();
QProcess process;
process.start("ping", QStringList() << IP << "-n" << "1" << "-w" << "50");
process.waitForFinished();
int exitCode = process.exitCode();
To copy to clipboard, switch view to plain text mode
Bookmarks