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. QNetworkConfigurationManager deprecated
Forum Updated to NodeBB v4.3 + New Features

QNetworkConfigurationManager deprecated

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 3 Posters 2.2k 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.
  • RobotechnicR Offline
    RobotechnicR Offline
    Robotechnic
    wrote on last edited by
    #1

    Hello,
    I want to scan wifi configuration of my computer to create an auto login program I was found this code:

    QNetworkConfigurationManager ncm;
    
            QList<QNetworkConfiguration> netcfgList = ncm.allConfigurations();
            for (QNetworkConfiguration &x : netcfgList)
            {
                if (x.bearerType() == QNetworkConfiguration::BearerWLAN && x.state() == QNetworkConfiguration::Defined)
                {
                     qDebug() <<x.name()<< x.type();
    
    
                }
            }
    

    This code work but I have recently upgraded my qt to 15.1.1 and it show me deprecated warning.
    What can I use in Qt 15.1.1 to do the same thing?
    My goal is only detect the current wifi's SSID.

    Thanks in advance.

    1 Reply Last reply
    0
    • Christian EhrlicherC Online
      Christian EhrlicherC Online
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      See QNetworkInterface::allInterfaces()

      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
      3
      • RobotechnicR Offline
        RobotechnicR Offline
        Robotechnic
        wrote on last edited by
        #3

        Thanks but, I want to get a way to get the name of Wifi hotpost where my computer is connected.
        I want to create a program that detect conexion portal and connect to to the portal if it have it on a db.
        Now, it have functional db, it can detect the portal and connect to it. My only one problem is detect that the computer is connected to wifi and then detect the wifi name to try to connect to the right portal.
        I don't want to use qprocess because this app will be instaled on a phone, or on a computer with windows or linux.

        1 Reply Last reply
        0
        • Christian EhrlicherC Online
          Christian EhrlicherC Online
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on last edited by
          #4

          I don't understand the problem. What's wrong with e.g. QNetworkInterface::humanReadableName() then?

          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
          • RobotechnicR Offline
            RobotechnicR Offline
            Robotechnic
            wrote on last edited by Robotechnic
            #5

            this code

            QList<QNetworkInterface> interfaces = QNetworkInterface::allInterfaces();
            
                for (QNetworkInterface i : interfaces){
                    qDebug()<<i.name()<<i.flags()<<i.humanReadableName();
                }
            

            return

            "lo" QFlags<QNetworkInterface::InterfaceFlag>(IsUp|IsRunning|IsLoopBack) "lo"
            "enp1s0" QFlags<QNetworkInterface::InterfaceFlag>(CanBroadcast|CanMulticast) "enp1s0"
            "wlp2s0" QFlags<QNetworkInterface::InterfaceFlag>(IsUp|IsRunning|CanBroadcast|CanMulticast) "wlp2s0"
            

            But I want the name of the Wifi in my case "Livebox-29d9"
            My problem is that this code:

            QNetworkConfigurationManager ncm;
            
                    QList<QNetworkConfiguration> netcfgList = ncm.allConfigurations();
                    for (QNetworkConfiguration &x : netcfgList)
                    {
                        if (x.bearerType() == QNetworkConfiguration::BearerWLAN && x.state() == QNetworkConfiguration::Active)
                        {
                             qDebug() <<x.name();
            
            
                        }
                    }
            

            is deprecated.

            T 1 Reply Last reply
            0
            • Christian EhrlicherC Online
              Christian EhrlicherC Online
              Christian Ehrlicher
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Ok, then you either have to stay with Qt5.15 or write it by your own.

              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
              • RobotechnicR Robotechnic

                this code

                QList<QNetworkInterface> interfaces = QNetworkInterface::allInterfaces();
                
                    for (QNetworkInterface i : interfaces){
                        qDebug()<<i.name()<<i.flags()<<i.humanReadableName();
                    }
                

                return

                "lo" QFlags<QNetworkInterface::InterfaceFlag>(IsUp|IsRunning|IsLoopBack) "lo"
                "enp1s0" QFlags<QNetworkInterface::InterfaceFlag>(CanBroadcast|CanMulticast) "enp1s0"
                "wlp2s0" QFlags<QNetworkInterface::InterfaceFlag>(IsUp|IsRunning|CanBroadcast|CanMulticast) "wlp2s0"
                

                But I want the name of the Wifi in my case "Livebox-29d9"
                My problem is that this code:

                QNetworkConfigurationManager ncm;
                
                        QList<QNetworkConfiguration> netcfgList = ncm.allConfigurations();
                        for (QNetworkConfiguration &x : netcfgList)
                        {
                            if (x.bearerType() == QNetworkConfiguration::BearerWLAN && x.state() == QNetworkConfiguration::Active)
                            {
                                 qDebug() <<x.name();
                
                
                            }
                        }
                

                is deprecated.

                T Offline
                T Offline
                Talya
                wrote on last edited by
                #7

                @Robotechnic Hi I'm in the same problem.
                Did you solve this?

                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