Some trouble with QNetworkAccessManager and wifi on Windows 7
I am using Qt 5.9.5 on Windows 7.
When I want to check the network, QNetworkAccessManager::networkAccessible() return NotAccessible...
When I use my internet browser, I have no problem to navigate on Internet.
Its works fine on Windows 10 and macOS. What I am missing to have this work on Windows 7?
You might have more than one interface so maybe you are asking the wrong one?
You can list the ones it knows
and see what is going on.
I have checked the active configuration and configuration on Windows7. Both doesn't get a valid configuration.
When I check the QNetworkConfiguration::allConfiguration, I can see 2 connections :
- Ethernet connection not pluged
- WiFi connection with QNetworkConfiguration::bearerTypeName equals Unknown
So maybe QNetworkAccessManager::configuration didn't get a configuration from QNetworkConfigurationManager?
That is a bit odd.
Same code just works on win 10 ?
Yes, same code works on Windows 10.
But when checked on them, they didn't found the wifi and have differents configurations:
- Teredo Tunneling Pseudo-Interface
- Virtual Ethernet like Hyper-V
- Some other interface with Internet possibility
I think it is not the best way to test if there are a possible internet connection...
If only to check for internet then i agree :)
Its much easier just to try to use it as it will then use the default interface like
all other apps.
nelbok last edited by nelbok
After some tests. It doesn't work on Qt 5.10 and Qt 5.11.
I have also tested with Qt 5.6.3 and I can see the WiFi connection.
But, when I cut my WiFi, Its keep the connection...
I think there are some trouble, I will fill a report to see if it is possible to improve this.
For your link, yes, it works as long that we can ping the server and the server is not offline or blocked.
I can always use https://msdn.microsoft.com/en-US/library/windows/desktop/aa384702(v=vs.85).aspx to know if we are connected.
Now I need to create a class that can send a signal when the connection change.
Ok, it sounds like a bug then.
Good if you open ticket.
Make sure to include a small complete working example they can use
to reproduce it.