The QSystemNetworkInfo class provides access to various networking status and signals. More...
#include <QSystemNetworkInfo>
Inherits QObject.
enum | CellDataTechnology { UnknownDataTechnology, GprsDataTechnology, EdgeDataTechnology, UmtsDataTechnology, HspaDataTechnology } |
enum | NetworkMode { UnknownMode, GsmMode, CdmaMode, WcdmaMode, ..., LteMode } |
enum | NetworkStatus { UndefinedStatus, NoNetworkAvailable, EmergencyOnly, Searching, ..., Roaming } |
|
|
QSystemNetworkInfo ( QObject * parent = 0 ) | |
~QSystemNetworkInfo () | |
QSystemNetworkInfo::CellDataTechnology | cellDataTechnology () |
int | cellId () |
QString | currentMobileCountryCode () |
QString | currentMobileNetworkCode () |
QSystemNetworkInfo::NetworkMode | currentMode () |
QString | homeMobileCountryCode () |
QString | homeMobileNetworkCode () |
QNetworkInterface | interfaceForMode ( QSystemNetworkInfo::NetworkMode mode ) |
int | locationAreaCode () |
QString | macAddress ( QSystemNetworkInfo::NetworkMode mode ) |
QSystemNetworkInfo::NetworkStatus | networkStatus ( QSystemNetworkInfo::NetworkMode mode ) |
void | cellDataTechnologyChanged ( QSystemNetworkInfo::CellDataTechnology ) |
void | cellIdChanged ( int cellId ) |
void | currentMobileCountryCodeChanged ( const QString & mcc ) |
void | currentMobileNetworkCodeChanged ( const QString & mnc ) |
void | networkModeChanged ( QSystemNetworkInfo::NetworkMode mode ) |
void | networkNameChanged ( QSystemNetworkInfo::NetworkMode mode, const QString & netName ) |
void | networkSignalStrengthChanged ( QSystemNetworkInfo::NetworkMode mode, int strength ) |
void | networkStatusChanged ( QSystemNetworkInfo::NetworkMode mode, QSystemNetworkInfo::NetworkStatus status ) |
QString | networkName ( QSystemNetworkInfo::NetworkMode mode ) |
int | networkSignalStrength ( QSystemNetworkInfo::NetworkMode mode ) |
The QSystemNetworkInfo class provides access to various networking status and signals.
This enum describes the type of network:
Constant | Value | Description |
---|---|---|
QSystemNetworkInfo::UnknownMode | 0 | Unknown network, or network error. |
QSystemNetworkInfo::GsmMode | 1 | Global System for Mobile (GSM) network. |
QSystemNetworkInfo::CdmaMode | 2 | Code division multiple access (CDMA) network. |
QSystemNetworkInfo::WcdmaMode | 3 | Wideband Code Division Multiple Access (W-CDMA) network. |
QSystemNetworkInfo::WlanMode | 4 | Wireless Local Area Network (WLAN) network. |
QSystemNetworkInfo::EthernetMode | 5 | Wired Local Area network. |
QSystemNetworkInfo::BluetoothMode | 6 | Bluetooth network. |
QSystemNetworkInfo::WimaxMode | 7 | Wimax network. |
QSystemNetworkInfo::GprsMode | ? | Gprs network |
QSystemNetworkInfo::EdgeMode | ? | Edge network. |
QSystemNetworkInfo::HspaMode | ? | Hspa network. |
QSystemNetworkInfo::LteMode | 8 | Lte network. |
This enum describes the status of the network connection:
Constant | Value | Description |
---|---|---|
QSystemNetworkInfo::UndefinedStatus | 0 | There is no network device, or error. |
QSystemNetworkInfo::NoNetworkAvailable | 1 | There is no network available. |
QSystemNetworkInfo::EmergencyOnly | 2 | Emergency calls only. |
QSystemNetworkInfo::Searching | 3 | Searching for or connecting with the network. |
QSystemNetworkInfo::Busy | 4 | Network is busy. |
QSystemNetworkInfo::Connected | 5 | Connected to network. |
QSystemNetworkInfo::HomeNetwork | 6 | On Home Network. |
QSystemNetworkInfo::Denied | 7 | Network access denied. |
QSystemNetworkInfo::Roaming | 8 | On Roaming network. |
Returns the current active cell data technology. If no data technology is active, returns QSystemNetworkInfo::NoDataTechnology. If data technology is not supported, this will return QSystemNetworkInfo::UnknownDataTechnology
Access functions:
QSystemNetworkInfo::CellDataTechnology | cellDataTechnology () |
Notifier signal:
void | cellDataTechnologyChanged ( QSystemNetworkInfo::CellDataTechnology ) |
This property holds the devices Cell ID Returns the Cell ID of the connected tower or based station, or 0 if not connected.
Access functions:
int | cellId () |
Notifier signal:
void | cellIdChanged ( int cellId ) |
This property holds the current MCC.
Returns the current Mobile Country Code. In the case of a Desktop computer, an empty string is returned.
Access functions:
QString | currentMobileCountryCode () |
Notifier signal:
void | currentMobileCountryCodeChanged ( const QString & mcc ) |
This property holds the current MNC.
Returns the current Mobile Network Code. In the case of a Desktop computer, an empty string is returned.
Access functions:
QString | currentMobileNetworkCode () |
Notifier signal:
void | currentMobileNetworkCodeChanged ( const QString & mnc ) |
Returns the current active mode. If more than one mode is active, returns the default or preferred mode. If no modes are active, returns UnknownMode.
Access functions:
QSystemNetworkInfo::NetworkMode | currentMode () |
This property holds the home MNC.
Returns the home Mobile Country Code. In the case of a Desktop computer, an empty string is returned.
Access functions:
QString | homeMobileCountryCode () |
This property holds the home MCC.
Returns the home Mobile Network Code. In the case of a Desktop computer, an empty string is returned. Note: Some platforms don't support retrieving this info. In this case the Network Code is returned only when the device is registered on home network.
Access functions:
QString | homeMobileNetworkCode () |
This property holds the LAC.
Returns the Location Area Code. In the case of a Desktop computer, 0 is returned.
Access functions:
int | locationAreaCode () |
Constructs a QSystemNetworkInfo with the given parent.
Destroys the QSystemNetworkInfo object.
This signal is emitted whenever the network cell changes, specified by cellId.
This signal is emitted whenever the Mobile Country Code changes, specified by mcc.
This signal is emitted whenever the network Mobile Network Code changes, specified by mnc.
Returns the first found QNetworkInterface for type mode, or an invalid QNetworkInterface, if none is found.
Returns the MAC address for the interface servicing the network mode.
This signal is emitted whenever the network mode changes, specified by mode.
Returns the name of the operator for the network mode. For wlan this returns the network's current SSID. In the case of a Desktop computer, an empty string is returned.
This signal is emitted whenever the network mode name changes, specified by netName.
Returns the strength of the network signal, per network mode , 0 - 100 linear scaling, or -1 in the case of unknown network mode or error.
In the case of QSystemNetworkInfo::EthMode, it will either be 100 for carrier active, or 0 for when there is no carrier or cable connected.
This signal is emitted whenever the network mode signal strength changes, specified by strength.
Returns the status of the network mode.
This signal is emitted whenever the network status of mode changes, specified by status.