Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Classes principales  ·  Annotées  ·  Classes groupées  ·  Modules  ·  Fonctions  · 

QNetworkInfo Class

The QNetworkInfo class provides various information about the network status. More...

 #include <QNetworkInfo>

Inherits: QObject.

Public Types

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

Public Functions

QNetworkInfo(QObject * parent = 0)
virtual ~QNetworkInfo()
QString cellId(int interface) const
QNetworkInfo::CellDataTechnology currentCellDataTechnology(int interface) const
QString currentMobileCountryCode(int interface) const
QString currentMobileNetworkCode(int interface) const
QNetworkInfo::NetworkMode currentNetworkMode() const
QString homeMobileCountryCode(int interface) const
QString homeMobileNetworkCode(int interface) const
QString imsi(int interface) const
QNetworkInterface interfaceForMode(QNetworkInfo::NetworkMode mode, int interface) const
QString locationAreaCode(int interface) const
QString macAddress(QNetworkInfo::NetworkMode mode, int interface) const
int networkInterfaceCount(QNetworkInfo::NetworkMode mode) const
QString networkName(QNetworkInfo::NetworkMode mode, int interface) const
int networkSignalStrength(QNetworkInfo::NetworkMode mode, int interface) const
QNetworkInfo::NetworkStatus networkStatus(QNetworkInfo::NetworkMode mode, int interface) const
  • 31 public functions inherited from QObject

Signals

void cellIdChanged(int interface, const QString & id)
void currentCellDataTechnologyChanged(int interface, QNetworkInfo::CellDataTechnology tech)
void currentMobileCountryCodeChanged(int interface, const QString & mcc)
void currentMobileNetworkCodeChanged(int interface, const QString & mnc)
void currentNetworkModeChanged(QNetworkInfo::NetworkMode mode)
void locationAreaCodeChanged(int interface, const QString & lac)
void networkInterfaceCountChanged(QNetworkInfo::NetworkMode mode, int count)
void networkNameChanged(QNetworkInfo::NetworkMode mode, int interface, const QString & name)
void networkSignalStrengthChanged(QNetworkInfo::NetworkMode mode, int interface, int strength)
void networkStatusChanged(QNetworkInfo::NetworkMode mode, int interface, QNetworkInfo::NetworkStatus status)

Additional Inherited Members

  • 1 property inherited from QObject
  • 1 public slot inherited from QObject
  • 11 static public members inherited from QObject
  • 9 protected functions inherited from QObject

Detailed Description

The QNetworkInfo class provides various information about the network status.

To support the cases where one has multiple interfaces / modems for the same network mode, you can specify which interface you refer to. For those cases, the 'interface' parameter is the index of the interface, starting from 0.

Member Type Documentation

enum QNetworkInfo::CellDataTechnology

This enum describes the type of cellular technology.

ConstantValueDescription
QNetworkInfo::UnknownDataTechnology0The cellular technology is unknown or an error occured.
QNetworkInfo::GprsDataTechnology1General Packet Radio Service (GPRS) data service.
QNetworkInfo::EdgeDataTechnology2Enhanced Data Rates for GSM Evolution (EDGE) data service.
QNetworkInfo::UmtsDataTechnology3Universal Mobile Telecommunications System (UMTS) data service.
QNetworkInfo::HspaDataTechnology4High Speed Packet Access (HSPA) data service.

enum QNetworkInfo::NetworkMode

This enumeration describes the type of the network.

ConstantValueDescription
QNetworkInfo::UnknownMode0The network is unknown or an error occured.
QNetworkInfo::GsmMode1Global System for Mobile (GSM) network.
QNetworkInfo::CdmaMode2Code Division Multiple Access (CDMA) network.
QNetworkInfo::WcdmaMode3Wideband Code Division Multiple Access (WCDMA) network.
QNetworkInfo::WlanMode4Wireless local area network (WLAN) network.
QNetworkInfo::EthernetMode5Local area network (LAN), or Ethernet network.
QNetworkInfo::BluetoothMode6Bluetooth network.
QNetworkInfo::WimaxMode7Worldwide Interoperability for Microwave Access (WiMAX) network.
QNetworkInfo::LteMode83GPP Long Term Evolution (LTE) network.
QNetworkInfo::TdscdmaMode9Time Division Synchronous Code Division Multiple Access (TD-SCDMA) network.

enum QNetworkInfo::NetworkStatus

This enumeration describes the status of the network.

ConstantValueDescription
QNetworkInfo::UnknownStatus0The status is unknown or an error occured.
QNetworkInfo::NoNetworkAvailable1There is no network available.
QNetworkInfo::EmergencyOnly2The network only allows emergency calls.
QNetworkInfo::Searching3The device is searching or connecting to the network.
QNetworkInfo::Busy4The network is too busy to be connected.
QNetworkInfo::Denied5The connection to the network has been denied.
QNetworkInfo::HomeNetwork6The device is connected to the home network.
QNetworkInfo::Roaming7The device is connected to some roaming network.

Member Function Documentation

QNetworkInfo::QNetworkInfo(QObject * parent = 0)

Constructs a QNetworkInfo object with the given parent.

QNetworkInfo::~QNetworkInfo() [virtual]

Destroys the object

QString QNetworkInfo::cellId(int interface) const

Returns the cell ID of the connected tower or based station for interface. If this information is not available or error occurs, an empty string is returned.

void QNetworkInfo::cellIdChanged(int interface, const QString & id) [signal]

This signal is emitted whenever the cell ID for interface has changed to id.

QNetworkInfo::CellDataTechnology QNetworkInfo::currentCellDataTechnology(int interface) const

Returns the current cell data technology used for interface.

void QNetworkInfo::currentCellDataTechnologyChanged(int interface, QNetworkInfo::CellDataTechnology tech) [signal]

This signal is emitted whenever the current cell data technology for interface has changed to tech.

QString QNetworkInfo::currentMobileCountryCode(int interface) const

Returns the current Mobile Country Code (MCC) for interface. An empty string is returned if the information is not available or an error occurs.

void QNetworkInfo::currentMobileCountryCodeChanged(int interface, const QString & mcc) [signal]

This signal is emitted whenever the current Mobile Country Code (MCC) for interface has changed to mcc.

QString QNetworkInfo::currentMobileNetworkCode(int interface) const

Returns the current Mobile Network Code (MNC) for interface. An empty string is returned if the information is not available or an error occurs.

void QNetworkInfo::currentMobileNetworkCodeChanged(int interface, const QString & mnc) [signal]

This signal is emitted whenever the current Mobile Network Code (MNC) for interface has changed to mnc.

QNetworkInfo::NetworkMode QNetworkInfo::currentNetworkMode() const

Returns the current active network mode. If there are more than one modes activated, the preferred one is returned.

void QNetworkInfo::currentNetworkModeChanged(QNetworkInfo::NetworkMode mode) [signal]

This signal is emitted whenever the current network has changed to mode.

QString QNetworkInfo::homeMobileCountryCode(int interface) const

Returns the home Mobile Country Code (MCC) for interface. An empty string is returned if the information is not available or an error occurs.

QString QNetworkInfo::homeMobileNetworkCode(int interface) const

Returns the home Mobile Network Code (MNC) for interface. An empty string is returned if the information is not available or an error occurs.

QString QNetworkInfo::imsi(int interface) const

Returns the International Mobile Subscriber Identity (IMSI) for interface. If this information is not available, or error occurs, an empty string is returned.

QNetworkInterface QNetworkInfo::interfaceForMode(QNetworkInfo::NetworkMode mode, int interface) const

Returns the first found interface for interface of mode. If none is found, or it can't be represented by QNetworkInterface (e.g. Bluetooth), and empty object is returned.

QString QNetworkInfo::locationAreaCode(int interface) const

Returns the location area code of the current cellular radio network for interface. If this information is not available or error occurs, an empty string is returned.

void QNetworkInfo::locationAreaCodeChanged(int interface, const QString & lac) [signal]

This signal is emitted whenever the location area code for interface has changed to lac.

QString QNetworkInfo::macAddress(QNetworkInfo::NetworkMode mode, int interface) const

Returns the MAC address for interface of mode. If the MAC address is not available or error occurs, an empty string is returned.

int QNetworkInfo::networkInterfaceCount(QNetworkInfo::NetworkMode mode) const

Returns the number of interfaces for the mode. If the information is not available, or error occurs, -1 is returned.

void QNetworkInfo::networkInterfaceCountChanged(QNetworkInfo::NetworkMode mode, int count) [signal]

This signal is emitted whenever the number of interfaces for the mode has changed to count.

QString QNetworkInfo::networkName(QNetworkInfo::NetworkMode mode, int interface) const

Returns the name of the operator for interface of mode. If the information is not available, or an error occurs, an empty string is returned.

In case of WLAN, the SSID is returned; for Ethernet, the domain name is returned if available.

void QNetworkInfo::networkNameChanged(QNetworkInfo::NetworkMode mode, int interface, const QString & name) [signal]

This signal is emitted whenever the name for the interface of mode has changed to name.

int QNetworkInfo::networkSignalStrength(QNetworkInfo::NetworkMode mode, int interface) const

Returns the signal strength for interface of mode, in 0 - 100 scale. If the information is not available, or error occurs, -1 is returned.

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

This signal is emitted whenever the signal strength for the interface of mode has changed to strength.

QNetworkInfo::NetworkStatus QNetworkInfo::networkStatus(QNetworkInfo::NetworkMode mode, int interface) const

Returns the current status for interface of mode.

void QNetworkInfo::networkStatusChanged(QNetworkInfo::NetworkMode mode, int interface, QNetworkInfo::NetworkStatus status) [signal]

This signal is emitted whenever the status for the interface of mode has changed to status.

Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt 5.0-snapshot
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web