I have exactly this problem described here: http://stackoverflow.com/questions/1...achable-or-not but the solution provided didn't solve my problem. I am at a linux machine as the guy who had the similar problem. In fact the code is like this:

Qt Code:
  1. QProcess *connected = new QProcess(0);
  2. QString exec="ping";
  3. QStringList params;
  4. params << "-c" << "1" << "http://www.google.com";
  5. connected->start(exec,params);
  6. if(!connected->waitForFinished())
  7. return false;
  8. cout << "The exit code is " << connected->exitCode() << endl;
  9. delete connected;
To copy to clipboard, switch view to plain text mode 

The ping process does execute and I always get the value '2' returned from connected->exitCode(). I have no idea why, but if I place instead of google.com the actual IP of google.com it seems to return the code correctly. But I don't know if google has static IP or not and I don't want to risk it anyway... Any suggestions or tips why is this happening and how to fix it ?