NetworkInformation QML Type

Provides a cross-platform interface to network-related information. More...

Import Statement: import QtNetwork
Since: Qt 6.7
Instantiates: QNetworkInformation

Properties

Detailed Description

NetworkInformation provides a cross-platform interface to network-related information.

NetworkInformation is a singleton.

See also QNetworkInformation.

Property Documentation

isBehindCaptivePortal : bool [read-only]

Indicates if the user's device is currently known to be behind a captive portal.


isMetered : bool [read-only]

Returns whether the current connection is (known to be) metered or not.


reachability : enumeration [read-only]

Holds the current state of the system's network connectivity.

ConstantDescription
NetworkInformation.Reachability.UnknownConnection may be established but the OS has yet to confirm full connectivity, or this feature is not supported.
NetworkInformation.Reachability.DisconnectedThe system may not have connectivity at all.
NetworkInformation.Reachability.LocalThe system is connected to a network, but might only be able to access devices on the local network.
NetworkInformation.Reachability.SiteThe system is connected to a network, but might only be able to access devices on the local subnet or an intranet.
NetworkInformation.Reachability.OnlineThe system is connected to a network and able to access the Internet.

transportMedium : enumeration [read-only]

Holds the currently active transport medium for the application.

ConstantDescription
NetworkInformation.TransportMedium.UnknownIf the OS reports no active medium, the active medium is not recognized by Qt, or the TransportMedium feature is not supported.
NetworkInformation.TransportMedium.EthernetThe currently active connection is using Ethernet. Note: This value may also be returned when Windows is connected to a Bluetooth personal area network.
NetworkInformation.TransportMedium.CellularThe currently active connection is using a cellular network.
NetworkInformation.TransportMedium.WiFiThe currently active connection is using Wi-Fi.
NetworkInformation.TransportMedium.BluetoothThe currently active connection is connected using Bluetooth.