The QSystemNetworkInfo class provides access to various networking status and signals. More...
#include <QSystemNetworkInfo>
Inherits: QObject.
Note: All functions in this class are reentrant.
This class was introduced in Qt Mobility 1.0.
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 cellTech ) |
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 & name ) |
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.
Note: Most functions in this class are reentrant on all platforms. The exceptions are listed below.
Warning: On Symbian this class does not support QObject::moveToThread().
This enum describes the type of cellular technology:
Constant | Value | Description |
---|---|---|
QSystemNetworkInfo::UnknownDataTechnology | 0 | Unknown cellular technology, or error. |
QSystemNetworkInfo::GprsDataTechnology | 1 | General Packet Radio Service (GPRS) data service. |
QSystemNetworkInfo::EdgeDataTechnology | 2 | Enhanced Data Rates for GSM Evolution (EDGE) data service. |
QSystemNetworkInfo::UmtsDataTechnology | 3 | Universal Mobile Telecommunications System (UMTS) data service. |
QSystemNetworkInfo::HspaDataTechnology | 4 | High Speed Packet Access (HSPA) data service. |
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::LteMode | 8 | Lte network. Since 1.2 |
This enum describes the status of the network connection:
Constant | Value | Description |
---|---|---|
QSystemNetworkInfo::UndefinedStatus | 0 | There is no network device, or on 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, or data technology is not supported, QSystemNetworkInfo::UnknownDataTechnology is returned.
This property was introduced in Qt Mobility 1.2.
Access functions:
QSystemNetworkInfo::CellDataTechnology | cellDataTechnology () |
Notifier signal:
void | cellDataTechnologyChanged ( QSystemNetworkInfo::CellDataTechnology cellTech ) |
This property holds the devices Cell ID.
Returns the Cell ID of the connected tower or based station. -1 is returned if not available or on error.
This property was introduced in Qt Mobility 1.2.
Access functions:
int | cellId () |
Notifier signal:
void | cellIdChanged ( int cellId ) |
This property holds the current MCC.
Returns the current Mobile Country Code. An empty string is returned if not available or on error.
This property was introduced in Qt Mobility 1.0.
Access functions:
QString | currentMobileCountryCode () |
Notifier signal:
void | currentMobileCountryCodeChanged ( const QString & mcc ) |
This property holds the current MNC.
Returns the current Mobile Network Code. An empty string is returned if not available or on error.
This property was introduced in Qt Mobility 1.0.
Access functions:
QString | currentMobileNetworkCode () |
Notifier signal:
void | currentMobileNetworkCodeChanged ( const QString & mnc ) |
Returns the current active network mode. If more than one mode is active, returns the default or preferred mode. If no modes are active, returns UnknownMode.
This property was introduced in Qt Mobility 1.0.
Access functions:
QSystemNetworkInfo::NetworkMode | currentMode () |
This property holds the home MNC.
Returns the home Mobile Country Code. An empty string is returned if not available or on error.
This property was introduced in Qt Mobility 1.0.
Access functions:
QString | homeMobileCountryCode () |
This property holds the home MCC.
Returns the home Mobile Network Code. An empty string is returned if not available or on error.
This property was introduced in Qt Mobility 1.0.
Access functions:
QString | homeMobileNetworkCode () |
This property holds the LAC.
Returns the location area code of the current cellular radio network. -1 is returned if not available or on error.
This property was introduced in Qt Mobility 1.0.
Access functions:
int | locationAreaCode () |
Constructs a QSystemNetworkInfo with the given parent.
Destroys the QSystemNetworkInfo object.
This signal is emitted whenever the cellular technology changes, specified by cellTech.
This function was introduced in Qt Mobility 1.2.
This signal is emitted whenever the network cell changes, specified by cellId.
This function was introduced in Qt Mobility 1.2.
This signal is emitted whenever the Mobile Country Code changes, specified by mcc.
This function was introduced in Qt Mobility 1.0.
This signal is emitted whenever the network Mobile Network Code changes, specified by mnc.
This function was introduced in Qt Mobility 1.0.
Returns the first found QNetworkInterface for type mode. If none is found, or it can't be represented by QNetworkInterface (e.g. Bluetooth), an invalid QNetworkInterface object is returned.
This function was introduced in Qt Mobility 1.0.
Returns the MAC address for the interface servicing the network mode. An empty string is returned if not available or on error.
This function was introduced in Qt Mobility 1.0.
This signal is emitted whenever the network mode changes, specified by mode.
This function was introduced in Qt Mobility 1.0.
Returns the name of the operator for the network mode. An empty string is returned if not available or on error.
For WLAN this returns the network's current SSID.
Warning: On Symbian this function is not reentrant and must be used from main thread only.
This function was introduced in Qt Mobility 1.0.
This signal is emitted whenever the network mode name changes, specified by name.
This function was introduced in Qt Mobility 1.0.
Returns the strength of the network signal, per network mode , 0 - 100 linear scaling. -1 is returned if not available or on error.
Warning: On Symbian this function is not reentrant and must be used from main thread only.
This function was introduced in Qt Mobility 1.0.
This signal is emitted whenever the network mode signal strength changes, specified by strength.
This function was introduced in Qt Mobility 1.0.
Returns the status of the network mode.
This function was introduced in Qt Mobility 1.0.
This signal is emitted whenever the network status of mode changes, specified by status.
This function was introduced in Qt Mobility 1.0.
© 2008-2011 Nokia Corporation and/or its subsidiaries. Nokia, Qt and their respective logos are trademarks of Nokia Corporation in Finland and/or other countries worldwide.
All other trademarks are property of their respective owners. Privacy Policy
Licensees holding valid Qt Commercial licenses may use this document in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and Nokia.
Alternatively, this document may be used under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation.