Running under Windows 10, tested with two different Systems:
When i run QNetworkConfigurationManager::allConfigurations()
I don't get any WLAN configuration, even if I'm connected actively to a Wifi Network.
Header:
public:
NetworkManager(QObject* parent = 0);
private slots:
void onNetworkConfigUpdate();
private:
QNetworkConfiguration cfg;
QList<QNetworkConfiguration> netcfgList;
QNetworkConfigurationManager ncm;
.cpp
NetworkManager::NetworkManager(QObject* parent) : QObject(parent) {
ncm.updateConfigurations();
connect(&ncm, SIGNAL(updateCompleted()), this, SLOT(onNetworkConfigUpdate()));
}
void NetworkManager::onNetworkConfigUpdate() {
netcfgList = ncm.allConfigurations();
for (auto& x : netcfgList) {
if (x.bearerType() == QNetworkConfiguration::BearerWLAN) {
qDebug() << "Wifi found: " << x.name();
} else {
qDebug() << "Something else: " << x.bearerType() << " - name: " << x.name();
}
}
}
Output:
Something else: 0 - name: "Teredo Tunneling Pseudo-Interface"
Something else: 1 - name: "Ethernet"
Something else: 1 - name: "VirtualBox Host-Only Network"
I'm running on Windows 10; Qt 5.9.4 with MSVC2015
I checked with an Intel Wireless Card and an external USB Wifi-Stick. Why is it not showing any WLAN?
I had the same problem. To me was caused by a missing bearer plugin DLL.
To sort this out, I had to copy the QT "plugins/bearer" folder (containing qgenericbearer.dll and qnativewifibearer.dll) in my application root folder.
Like this:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With