NetworkInformation QML Type
为网络相关信息提供跨平台接口。更多
Import Statement: | import QtNetwork |
Since: | Qt 6.7 |
In C++: | QNetworkInformation |
属性
- isBehindCaptivePortal : bool
- isMetered : bool
- reachability : enumeration
- transportMedium : enumeration
详细说明
NetworkInformation 为网络相关信息提供了一个跨平台接口。
NetworkInformation 是一个单例。
另请参阅 QNetworkInformation 。
属性文档
isBehindCaptivePortal : bool |
指示用户的设备当前是否处于专属门户后面。
isMetered : bool |
返回当前连接是否(已知)计量。
reachability : enumeration |
保持系统网络连接的当前状态。
常量 | 说明 |
---|---|
NetworkInformation.Reachability.Unknown | 连接可能已建立,但操作系统尚未确认完全连接,或不支持此功能。 |
NetworkInformation.Reachability.Disconnected | 系统可能根本没有连接。 |
NetworkInformation.Reachability.Local | 系统已连接到网络,但可能只能访问本地网络上的设备。 |
NetworkInformation.Reachability.Site | 系统已连接到网络,但可能只能访问本地子网或内网上的设备。 |
NetworkInformation.Reachability.Online | 系统已连接到网络,可以访问互联网。 |
transportMedium : enumeration |
为应用程序保存当前活动的传输介质。
常数 | 说明 |
---|---|
NetworkInformation.TransportMedium.Unknown | 如果操作系统报告无活动介质,则活动介质未被 Qt 识别,或不支持 TransportMedium 功能。 |
NetworkInformation.TransportMedium.Ethernet | 当前活动连接使用的是以太网。注:当 Windows 连接到蓝牙个人局域网时,也可能返回此值。 |
NetworkInformation.TransportMedium.Cellular | 当前活动连接使用的是蜂窝网络。 |
NetworkInformation.TransportMedium.WiFi | 当前活动连接使用的是 Wi-Fi。 |
NetworkInformation.TransportMedium.Bluetooth | 当前活动连接使用蓝牙连接。 |
© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.