Currently I use this code for retrieving the ping of a target system. However it works so far only under linux and it is likely dependent on the locale settings. To add suppor
Nejat's code didn't work for me neither. Maybe it's Windows specific (tested on Windows 7 x64 + Qt 5.6). Ping command seems to distinct parameters and values and needs them to be passed apart when creating QProcess.
So instead of passing "-n 1" in one go, you'll need to pass "-n" and "1" separately.
Basically, with Nejat's code it would be:
int exitCode = QProcess::execute("ping", QStringList()
<< "-n" << "1"
<< m_sHostName);
if (exitCode==0) {
// it's alive
} else {
// it's dead
}
Tested and working now.