Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

QtWebKit: Retrieving Connected Wifi Name in Ubuntu



  • I'm using Ubuntu 18.04.

    How do I retrieve the name of the WiFi that the system is connected to. So far I'm querying with the following but it is returning interface names instead of Wifi names:

        QNetworkConfigurationManager nwkMgr;
        QList<QNetworkConfiguration> nwkCnfList = nwkMgr.allConfigurations();
        for(const QNetworkConfiguration &ncnf : nwkCnfList)
        {
            qDebug() << ncnf.name() << ncnf.bearerType();
            if (ncnf.bearerType() == QNetworkConfiguration::BearerWLAN)
            {
               // would like to detect WiFi here
               qDebug() << "WiFi:" << ncnf.name();
            }
        }
    

    This lists the interfaces:

    "Wired connection 1" 1
    "ens33" 1
    

    How can I get the NAME of the Wifi?


Log in to reply