#include #include #include #include #include #include // Demonstrating: Qt 5.11.1 Win10x64 // - On a Win10x64 system the WLAN is connected and working // - Neverthless QAM reports it as NotAccessible // - as a result all signals based on this as networkAccessibleChanged are wrong and not working properly // - also the network configuration is not properly discovered // - A request however works, although the network is reported NotAccessible int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); QNetworkAccessManager qam; QObject::connect(&qam, &QNetworkAccessManager::finished, &qam, [](QNetworkReply * reply) { QScopedPointer r(reply); qDebug() << "Reply received" << r->url().toString() << r->error(); }); /** with working cable QAM QNetworkAccessManager::NetworkAccessibility(Accessible) Config QFlags(0x2|0x4|0x8) 1 1 Reply received "https://www.heise.de" QNetworkReply::NetworkError(NoError) with working WLAN QAM QNetworkAccessManager::NetworkAccessibility(NotAccessible) WRONG!! Config QFlags(0x1) 0 0 NOT detected Reply received "https://www.heise.de" QNetworkReply::NetworkError(NoError) **/ qDebug() << "QAM" << qam.networkAccessible(); qDebug() << "Config" << qam.activeConfiguration().state() << qam.activeConfiguration().bearerType() << qam.activeConfiguration().bearerTypeFamily(); QUrl url("https://www.heise.de"); QNetworkRequest req(url); QNetworkReply *reply = qam.get(req); Q_UNUSED(reply); // just to handle the finished signal above QCoreApplication::processEvents(QEventLoop::AllEvents, 5000); return a.exec(); }