MeeGo 1.2 Harmattan Developer Documentation Develop for the Nokia N9

QSystemNetworkInfo Class Reference

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.

Public Types

enum CellDataTechnology { UnknownDataTechnology, GprsDataTechnology, EdgeDataTechnology, UmtsDataTechnology, HspaDataTechnology }
enum NetworkMode { UnknownMode, GsmMode, CdmaMode, WcdmaMode, ..., LteMode }
enum NetworkStatus { UndefinedStatus, NoNetworkAvailable, EmergencyOnly, Searching, ..., Roaming }

Properties

  • 1 property inherited from QObject

Public Functions

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 )
  • 29 public functions inherited from QObject

Signals

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 )

Static Public Members

QString networkName ( QSystemNetworkInfo::NetworkMode mode )
int networkSignalStrength ( QSystemNetworkInfo::NetworkMode mode )
  • 4 static public members inherited from QObject

Additional Inherited Members

  • 1 public slot inherited from QObject
  • 1 public variable inherited from QObject
  • 7 protected functions inherited from QObject
  • 2 protected variables inherited from QObject

Detailed Description

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().

Member Type Documentation

enum QSystemNetworkInfo::CellDataTechnology

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.

enum QSystemNetworkInfo::NetworkMode

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

enum QSystemNetworkInfo::NetworkStatus

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.

Property Documentation

cellDataTechnology : const QSystemNetworkInfo::CellDataTechnology

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 )

cellId : const int

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 )

currentMobileCountryCode : const QString

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 )

currentMobileNetworkCode : const QString

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 )

currentMode : const QSystemNetworkInfo::NetworkMode

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 ()

homeMobileCountryCode : const QString

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 ()

homeMobileNetworkCode : const QString

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 ()

locationAreaCode : const int

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 ()

Member Function Documentation

QSystemNetworkInfo::QSystemNetworkInfo ( QObject * parent = 0 )

Constructs a QSystemNetworkInfo with the given parent.

QSystemNetworkInfo::~QSystemNetworkInfo ()

Destroys the QSystemNetworkInfo object.

void QSystemNetworkInfo::cellDataTechnologyChanged ( QSystemNetworkInfo::CellDataTechnology cellTech ) [signal]

This signal is emitted whenever the cellular technology changes, specified by cellTech.

This function was introduced in Qt Mobility 1.2.

void QSystemNetworkInfo::cellIdChanged ( int cellId ) [signal]

This signal is emitted whenever the network cell changes, specified by cellId.

This function was introduced in Qt Mobility 1.2.

void QSystemNetworkInfo::currentMobileCountryCodeChanged ( const QString & mcc ) [signal]

This signal is emitted whenever the Mobile Country Code changes, specified by mcc.

This function was introduced in Qt Mobility 1.0.

void QSystemNetworkInfo::currentMobileNetworkCodeChanged ( const QString & mnc ) [signal]

This signal is emitted whenever the network Mobile Network Code changes, specified by mnc.

This function was introduced in Qt Mobility 1.0.

QNetworkInterface QSystemNetworkInfo::interfaceForMode ( QSystemNetworkInfo::NetworkMode mode )

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.

QString QSystemNetworkInfo::macAddress ( QSystemNetworkInfo::NetworkMode mode )

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.

void QSystemNetworkInfo::networkModeChanged ( QSystemNetworkInfo::NetworkMode mode ) [signal]

This signal is emitted whenever the network mode changes, specified by mode.

This function was introduced in Qt Mobility 1.0.

QString QSystemNetworkInfo::networkName ( QSystemNetworkInfo::NetworkMode mode ) [static]

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.

void QSystemNetworkInfo::networkNameChanged ( QSystemNetworkInfo::NetworkMode mode, const QString & name ) [signal]

This signal is emitted whenever the network mode name changes, specified by name.

This function was introduced in Qt Mobility 1.0.

int QSystemNetworkInfo::networkSignalStrength ( QSystemNetworkInfo::NetworkMode mode ) [static]

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.

void QSystemNetworkInfo::networkSignalStrengthChanged ( QSystemNetworkInfo::NetworkMode mode, int strength ) [signal]

This signal is emitted whenever the network mode signal strength changes, specified by strength.

This function was introduced in Qt Mobility 1.0.

QSystemNetworkInfo::NetworkStatus QSystemNetworkInfo::networkStatus ( QSystemNetworkInfo::NetworkMode mode )

Returns the status of the network mode.

This function was introduced in Qt Mobility 1.0.

void QSystemNetworkInfo::networkStatusChanged ( QSystemNetworkInfo::NetworkMode mode, QSystemNetworkInfo::NetworkStatus status ) [signal]

This signal is emitted whenever the network status of mode changes, specified by status.

This function was introduced in Qt Mobility 1.0.