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. Qt6.4.3, QNetworkInformation not working
Forum Updated to NodeBB v4.3 + New Features

Qt6.4.3, QNetworkInformation not working

Scheduled Pinned Locked Moved Solved General and Desktop
7 Posts 4 Posters 674 Views 3 Watching
  • 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.
  • A Offline
    A Offline
    Ang94
    wrote on last edited by
    #1

    I am trying to test the QNetworkInformation but it is not working.
    Version- Qt6.4.3 with Qt Creator 10.0.0
    Platform- Windows10
    c01706ad-9389-4b69-bca1-6019393a32a1-image.png
    4e76d095-c54f-4508-b846-f478f89b8d17-image.png
    Similar code was working on PyQt6.

    1 Reply Last reply
    0
    • A Ang94
      #include <QCoreApplication>
      #include<QNetworkInformation>
      #include<QDebug>
      
      int main(int argc, char *argv[])
      {
          QCoreApplication a(argc, argv);
          qInfo()<<QNetworkInformation::availableBackends();
          qInfo()<<QNetworkInformation::loadDefaultBackend();
          return a.exec();
      }
      
      Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #3

      Please run with QT_DEBUG_PLUGINS=1 and make sure that <QTDIR>/plugins/networkinformation/ contains a valid plugin.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      SGaistS A S 3 Replies Last reply
      0
      • A Offline
        A Offline
        Ang94
        wrote on last edited by
        #2
        #include <QCoreApplication>
        #include<QNetworkInformation>
        #include<QDebug>
        
        int main(int argc, char *argv[])
        {
            QCoreApplication a(argc, argv);
            qInfo()<<QNetworkInformation::availableBackends();
            qInfo()<<QNetworkInformation::loadDefaultBackend();
            return a.exec();
        }
        
        Christian EhrlicherC 1 Reply Last reply
        0
        • A Ang94
          #include <QCoreApplication>
          #include<QNetworkInformation>
          #include<QDebug>
          
          int main(int argc, char *argv[])
          {
              QCoreApplication a(argc, argv);
              qInfo()<<QNetworkInformation::availableBackends();
              qInfo()<<QNetworkInformation::loadDefaultBackend();
              return a.exec();
          }
          
          Christian EhrlicherC Offline
          Christian EhrlicherC Offline
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on last edited by
          #3

          Please run with QT_DEBUG_PLUGINS=1 and make sure that <QTDIR>/plugins/networkinformation/ contains a valid plugin.

          Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
          Visit the Qt Academy at https://academy.qt.io/catalog

          SGaistS A S 3 Replies Last reply
          0
          • Christian EhrlicherC Christian Ehrlicher

            Please run with QT_DEBUG_PLUGINS=1 and make sure that <QTDIR>/plugins/networkinformation/ contains a valid plugin.

            SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #4

            Hi,

            Beside the good hint of @Christian-Ehrlicher, can you say exactly what does not work ?
            The compilation ?
            At run time ?

            If the former, are you using qmake or CMake ?
            Did you include the Network module in your project ?

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            A 1 Reply Last reply
            0
            • SGaistS SGaist

              Hi,

              Beside the good hint of @Christian-Ehrlicher, can you say exactly what does not work ?
              The compilation ?
              At run time ?

              If the former, are you using qmake or CMake ?
              Did you include the Network module in your project ?

              A Offline
              A Offline
              Ang94
              wrote on last edited by Ang94
              #5

              @SGaist I'm using qmake and I have included QT+=network. This is the output I'm getting.
              5091879a-fdf9-46fb-b78f-9a37bf9dcf1f-image.png

              1 Reply Last reply
              0
              • Christian EhrlicherC Christian Ehrlicher

                Please run with QT_DEBUG_PLUGINS=1 and make sure that <QTDIR>/plugins/networkinformation/ contains a valid plugin.

                A Offline
                A Offline
                Ang94
                wrote on last edited by
                #6

                @Christian-Ehrlicher Thanks it worked. When building with MSVC2019 code works fine. It doesnot works when building with MinGW.

                So, I checked and found that directory <QTDIR>\6.4.3\msvc2019_64\plugins contains networkinformation plugin but <QTDIR>\6.4.3\mingw_64\plugins doesnot have networkinformation plugin.

                Should I copy networkinformation plugin from msvc2019_64\plugins to mingw_64\plugins, for it to work with mingw?

                1 Reply Last reply
                0
                • A Ang94 has marked this topic as solved on
                • Christian EhrlicherC Christian Ehrlicher

                  Please run with QT_DEBUG_PLUGINS=1 and make sure that <QTDIR>/plugins/networkinformation/ contains a valid plugin.

                  S Offline
                  S Offline
                  Shen sida
                  wrote on last edited by
                  #7

                  @Christian-Ehrlicher Hi
                  Could you please help me to solve the problem on embedded linux system?
                  Here is the information for you:

                  2729835e-c265-43ce-ba17-6bcfd9bea4f9-image.png

                  the plugin could be found but it couldn't be load by QNetworkInformation::loadBackendByName(QString("networkmanager")) or QNetworkInformation::loadDefaultBackend()

                  Let me know if you want to get other information for you.
                  System: Yocto Linux 5.15 with Qt 6.4.2

                  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