4#include <QtNetwork/private/qnetworkinformation_p.h>
6#include <QtCore/qglobal.h>
7#include <QtCore/private/qobject_p.h>
21 switch (connectivity) {
22 case G_NETWORK_CONNECTIVITY_LOCAL:
24 case G_NETWORK_CONNECTIVITY_LIMITED:
25 case G_NETWORK_CONNECTIVITY_PORTAL:
27 case G_NETWORK_CONNECTIVITY_FULL:
54 return QNetworkInformation::Features(Feature::Reachability | Feature::CaptivePortal);
64 GNetworkMonitor *networkMonitor =
nullptr;
87 if (!backend->isValid())
88 delete std::exchange(backend,
nullptr);
96: networkMonitor(g_network_monitor_get_default())
98 updateInformation(
this);
100 handlerId = g_signal_connect_swapped(networkMonitor,
"notify::connectivity",
101 G_CALLBACK(updateInformation),
this);
106 g_signal_handler_disconnect(networkMonitor, handlerId);
111 return G_OBJECT_TYPE_NAME(networkMonitor) !=
"GNetworkMonitorBase"_L1;
116 const auto connectivityState = g_network_monitor_get_connectivity(backend->networkMonitor);
117 const bool behindPortal = (connectivityState == G_NETWORK_CONNECTIVITY_PORTAL);
118 backend->
setReachability(reachabilityFromGNetworkConnectivity(connectivityState));
124#include "qglibnetworkinformationbackend.moc"
\macro QT_RESTRICTED_CAST_FROM_ASCII
Combined button and popup list for selecting options.
#define Q_LOGGING_CATEGORY(name,...)
#define Q_DECLARE_LOGGING_CATEGORY(name)
#define QStringLiteral(str)
QFileInfo info(fileName)
[8]