One good way is to verify that they can resolve domain names using QHostInfo . If they can, then they probably have Internet access:
QHostInfo::lookupHost("www.kde.org", this, SLOT(lookedUp(QHostInfo)));
Of course, you could just try connecting to the host, which even better proves that everything is working correctly. I would do it asynchronously, not synchronously, but this is really the best test.
source share