How to get current network access state?



  • Hi guys,
    is there any good solution to get current network accessible state?
    I know that QNetworkAccessManager::networkAccessible() can do this, but, it didn't work. I tried many times, it always return UnknowNetworkAccessible.
    I googled it, but there is no good answer for it.
    Do u guys have any good idea?



  • Start your search with looking at [[doc:QNetworkConfigurationManager]]. I think it will set you on the right track.



  • Hi Andre,
    I know that class. Maybe u wanted to say that i can get the network access state via QNetworkConfigurationManager::isOnline(), but actually, i tried this method, and it always returns true when i disable network adapter or enable it.
    What i want is whether Internet is accessed, unfortunately, it seems that QNetworkConfigurationManager can not work on it.
    [quote author="Andre" date="1347012772"]Start your search with looking at [[doc:QNetworkConfigurationManager]]. I think it will set you on the right track.[/quote]


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.