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. How to get speed network interface
Forum Updated to NodeBB v4.3 + New Features

How to get speed network interface

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 4 Posters 508 Views 1 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.
  • B Offline
    B Offline
    blackout69
    wrote on 5 Sept 2019, 16:32 last edited by blackout69 9 May 2019, 16:58
    #1

    Hi,
    how to get the connection speed of a given network interface?
    My code is:

      foreach (const QNetworkInterface &interface, QNetworkInterface::allInterfaces())
        {
          QNetworkInterface::InterfaceFlags flags = interface.flags();
          if ((flags & QNetworkInterface::IsRunning) && !(flags & QNetworkInterface::IsLoopBack))
            {
              foreach (const QNetworkAddressEntry &address, interface.addressEntries())
                {
                  if (address.ip().protocol() == QAbstractSocket::IPv4Protocol)
                    {
                      qDebug() << interface.humanReadableName();    // Nome Interfaccia
                      qDebug() << address.ip().toString();          // IP Address
                      qDebug() << address.netmask().toString();     // Subnet Address
                      qDebug() << interface.hardwareAddress();      // MAC Address
                      qDebug() << ................................. // Speed Network
                    }
                }
            }
        }
    

    Thank you
    blackout69

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 5 Sept 2019, 18:13 last edited by
      #2

      Hi,

      Do you mean getting whether it's in 10/100/1000Mb link state ?

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

      1 Reply Last reply
      0
      • B Offline
        B Offline
        blackout69
        wrote on 5 Sept 2019, 18:18 last edited by
        #3

        @sgaist said in How to get speed network interface:

        Do you mean getting whether it's in 10/100/1000Mb link state

        Yes.
        blackout69

        1 Reply Last reply
        0
        • F Offline
          F Offline
          fa_2
          wrote on 15 Oct 2023, 08:51 last edited by
          #4

          Does anyone have a solution ?

          C 1 Reply Last reply 15 Oct 2023, 08:55
          0
          • F fa_2
            15 Oct 2023, 08:51

            Does anyone have a solution ?

            C Offline
            C Offline
            Christian Ehrlicher
            Lifetime Qt Champion
            wrote on 15 Oct 2023, 08:55 last edited by
            #5

            @fa_2 said in How to get speed network interface:

            Does anyone have a solution ?

            No, Qt has no option for this. You have to go low-level by yourself.

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

            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