Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Some trouble with QNetworkAccessManager and wifi on Windows 7
QtWS25 Last Chance

Some trouble with QNetworkAccessManager and wifi on Windows 7

Scheduled Pinned Locked Moved Solved General and Desktop
qt5.9qtnetworkwindows 7
8 Posts 2 Posters 3.1k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    nelbok
    wrote on last edited by
    #1

    Hello,

    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?

    Regards,

    nelbok

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi
      You might have more than one interface so maybe you are asking the wrong one?
      You can list the ones it knows
      http://doc.qt.io/qt-5/qnetworkconfigurationmanager.html#allConfigurations
      and see what is going on.

      1 Reply Last reply
      2
      • N Offline
        N Offline
        nelbok
        wrote on last edited by
        #3

        Hello,

        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?

        Regards,

        nelbok

        mrjjM 1 Reply Last reply
        0
        • N nelbok

          Hello,

          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?

          Regards,

          nelbok

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Hi
          That is a bit odd.
          Same code just works on win 10 ?

          1 Reply Last reply
          0
          • N Offline
            N Offline
            nelbok
            wrote on last edited by
            #5

            Hello,

            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...

            Regards,

            nelbok

            1 Reply Last reply
            0
            • mrjjM Offline
              mrjjM Offline
              mrjj
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Hi
              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.
              http://amin-ahmadi.com/2016/04/05/check-internet-connection-availability-status-qt/

              1 Reply Last reply
              1
              • N Offline
                N Offline
                nelbok
                wrote on last edited by nelbok
                #7

                Hello,

                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.

                Regards,

                nelbok

                1 Reply Last reply
                0
                • mrjjM Offline
                  mrjjM Offline
                  mrjj
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  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.

                  1 Reply Last reply
                  0

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved