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  ·  Toutes les fonctions  ·  Vues d'ensemble  · 

QSystemNetworkInfo Class Reference

The QSystemNetworkInfo class provides access to network information from the system. More...

    #include <QSystemNetworkInfo>

Inherits QObject.


Public Types

enum NetworkMode { UnknownMode, GsmMode, CdmaMode, WcdmaMode, ..., WimaxMode }
flags NetworkModes
enum NetworkStatus { UndefinedStatus, NoNetworkAvailable, EmergencyOnly, Searching, ..., Roaming }

Properties

  • 1 property inherited from QObject

Public Functions

QSystemNetworkInfo ( QObject * parent = 0 )
~QSystemNetworkInfo ()
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 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 )

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 type inherited from QObject
  • 7 protected functions inherited from QObject
  • 2 protected variables inherited from QObject

Detailed Description

The QSystemNetworkInfo class provides access to network information from the system.


Member Type Documentation

enum QSystemNetworkInfo::NetworkMode
flags QSystemNetworkInfo::NetworkModes

This enum describes the type of network:

ConstantValueDescription
QSystemNetworkInfo::UnknownMode0Unknown network, or network error.
QSystemNetworkInfo::GsmMode1Global System for Mobile (GSM) network.
QSystemNetworkInfo::CdmaMode2Code division multiple access (CDMA) network.
QSystemNetworkInfo::WcdmaMode3Wideband Code Division Multiple Access (W-CDMA) network.
QSystemNetworkInfo::WlanMode4Wireless Local Area Network (WLAN) network.
QSystemNetworkInfo::EthernetMode5Wired Local Area network.
QSystemNetworkInfo::BluetoothMode6Bluetooth network.
QSystemNetworkInfo::WimaxMode7Wimax network.

The NetworkModes type is a typedef for QFlags<NetworkMode>. It stores an OR combination of NetworkMode values.

enum QSystemNetworkInfo::NetworkStatus

This enum describes the status of the network connection:

ConstantValueDescription
QSystemNetworkInfo::UndefinedStatus0There is no network device, or error.
QSystemNetworkInfo::NoNetworkAvailable1There is no network available.
QSystemNetworkInfo::EmergencyOnly2Emergency calls only.
QSystemNetworkInfo::Searching3Searching for or connecting with the network.
QSystemNetworkInfo::Busy4Network is busy.
QSystemNetworkInfo::Connected5Connected to network.
QSystemNetworkInfo::HomeNetwork6On Home Network.
QSystemNetworkInfo::Denied7Network access denied.
QSystemNetworkInfo::Roaming8On Roaming network.


Property Documentation

cellId : const int

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

currentMobileCountryCode : const QString

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 )

currentMobileNetworkCode : const QString

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 )

currentMode : const QSystemNetworkInfo::NetworkMode

Access functions:

QSystemNetworkInfo::NetworkMode currentMode ()

homeMobileCountryCode : const QString

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

homeMobileNetworkCode : const QString

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

locationAreaCode : const int

This property holds the LAC.

Returns the Location Area Code. In the case of a Desktop computer, 0 is returned.

Access functions:

int locationAreaCode ()

Member Function Documentation

QSystemNetworkInfo::QSystemNetworkInfo ( QObject * parent = 0 )

Constructs a QSystemNetworkInfo object with the given parent.

QSystemNetworkInfo::~QSystemNetworkInfo ()

Destroys the QSystemNetworkInfo object.

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

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

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

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

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

Returns the first found QNetworkInterface for type mode, or an invalid QNetworkInterface, if none is found.

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

Returns the MAC address for the interface servicing the network mode.

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

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

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

Returns the name of the operator for the network mode. For wlan this returns the network's current SSID. In the case of no network such as a desktop, an empty string.

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

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

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

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.

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

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

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

Returns the status of the network mode.

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

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

Publicité

Best Of

Actualités les plus lues

Semaine
Mois
Année
  1. « Quelque chose ne va vraiment pas avec les développeurs "modernes" », un développeur à "l'ancienne" critique la multiplication des bibliothèques 82
  2. Apercevoir la troisième dimension ou l'utilisation multithreadée d'OpenGL dans Qt, un article des Qt Quarterly traduit par Guillaume Belz 0
  3. Les développeurs ignorent-ils trop les failles découvertes dans leur code ? Prenez-vous en compte les remarques des autres ? 17
  4. BlackBerry 10 : premières images du prochain OS de RIM qui devrait intégrer des widgets et des tuiles inspirées de Windows Phone 0
  5. Quelles nouveautés de C++11 Visual C++ doit-il rapidement intégrer ? Donnez-nous votre avis 10
  6. Adieu qmake, bienvenue qbs : Qt Building Suite, un outil déclaratif et extensible pour la compilation de projets Qt 17
  7. 2017 : un quinquennat pour une nouvelle version du C++ ? Possible, selon Herb Sutter 6
Page suivante

Le blog Digia au hasard

Logo

Déploiement d'applications Qt Commercial sur les tablettes Windows 8

Le blog Digia est l'endroit privilégié pour la communication sur l'édition commerciale de Qt, où des réponses publiques sont apportées aux questions les plus posées au support. Lire l'article.

Communauté

Ressources

Liens utiles

Contact

  • Vous souhaitez rejoindre la rédaction ou proposer un tutoriel, une traduction, une question... ? Postez dans le forum Contribuez ou contactez-nous par MP ou par email (voir en bas de page).

Qt dans le magazine

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 qtmobility-1.0
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