The NetworkInfo element allows you to get information and receive notifications from the network. More...
This element was introduced in Mobility 1.1.
This element is part of the QtMobility.systeminfo 1.1 module. It is a convience class to make QML usage easier.
Note: To use notification signals, you need to set the monitor* properties to true.
The follow table lists the \b incompatible changes made to the start* functions from QtMobility 1.1 to QtMobility 1.2, where they became Q_PROPERTY
In QtMobility 1.2, the NetworkInfo Element was changed to work in one network mode at a time. You use the property \b mode to set which network mode it is in.
QtMobility 1.1 | QtMobility 1.2 | Notes |
---|---|---|
slot void startStatusChanged(); | void startStatusChanged(bool on); | Became Q_PROPERTY monitoringStatusChanges in QtMobility 1.2 |
void startSignalStrengthChanged(); | void startSignalStrengthChanged(bool) | Became Q_PROPERTY monitorSignalStrengthChanges in QtMobility 1.2 |
void startNameChanged() | void startNameChanged(bool on) | Became Q_PROPERTY monitorNameChanges in QtMobility 1.2 |
void startModeChanged() | void startModeChanged(bool on) | Became Q_PROPERTY monitorModeChanges in QtMobility 1.2 |
void startCurrentMobileCountryCodeChanged() | void startCurrentMobileCountryCodeChanged(bool on) | Became Q_PROPERTY monitorCurrentMobileCountryCodeChanges in QtMobility 1.2 |
void startCurrentMobileNetworkCodeChanged() | void startCurrentMobileNetworkCodeChanged(bool on) | Became Q_PROPERTY startCurrentMobileNetworkCodeChanged in QtMobility 1.2 |
void useMode(); | void mode() | Became Q_PROPERTY mode in QtMobility 1.2 |
Example new usage:
QtMobility 1.2:
NetworkInfo { id: wlaninfo mode: NetworkInfo.WlanMode; monitorNameChanges: true; monitorSignalStrengthChanges: true monitorStatusChanges: true monitorModeChanges: true onStatusChanged : { img = getImage(newStatus) } }
To use this in a mode other than the default mode given by currentMode, set the mode with mode.
import Qt 4.7 import QtMobility.systeminfo 1.1 Rectangle { NetworkInfo { id: wlaninfo mode: NetworkInfo.WlanMode; monitorNameChanges: true monitorSignalStrengthChanges: true } Text { id: signame color: "white" text: wlaninfo.networkName +" "+wlaninfo.networkSignalStrength; anchors.horizontalCenter: parent.horizontalCenter; anchors.verticalCenter: parent.verticalCenter; } }
See also QSystemNetworkInfo.
macAddress : string |
Returns this NetworkInfo's network interface's MAC address.
This property group was introduced in Mobility 1.1.
mode : enumeration |
Sets this NetworkInfo to use QSystemNetworkInfo::NetworkModes. Does not set the mode of the underlaying system.
If not set, the default is whatever defaultMode is.
This property group was introduced in Mobility 1.1.
monitorCurrentMobileNetworkCodeChanges : bool |
This property group was introduced in Mobility 1.2.
monitorModeChanges : bool |
This property group was introduced in Mobility 1.2.
monitorNameChanges : bool |
This property group was introduced in Mobility 1.2.
monitorSignalStrengthChanges : bool |
This property group was introduced in Mobility 1.2.
monitorStatusChanges : bool |
This property group was introduced in Mobility 1.2.
monitoringCellDataTechnologyChanges : bool |
This property group was introduced in Mobility 1.2.
See also QSystemNetworkInfo::cellDataTechnologyChanged.
monitoringCellIdChanges : bool |
This property group was introduced in Mobility 1.2.
monitoringCurrentMobileCountryCodeChanges : bool |
This property group was introduced in Mobility 1.2.
networkName : string |
Returns this NetworkInfo's network name.
This property group was introduced in Mobility 1.1.
networkSignalStrength : int |
Returns this NetworkInfo's network signal strength.
This property group was introduced in Mobility 1.1.
networkStatus : string |
Returns this NetworkInfo's network status.
The following table shows the mapping between the NetworkInfo NetworkStatus property and the QSystemNetworkInfo::NetworkStatus enum.
NetworkInfo.networkStatus | QSystemNetworkInfo::NetworkStatus |
---|---|
"Undefined" | QSystemNetworkInfo::UndefinedStatus |
"No Network Available" | QSystemNetworkInfo::NoNetworkAvailable |
"Emergency Only" | QSystemNetworkInfo::EmergencyOnly |
"Searching" | QSystemNetworkInfo::Searching |
"Busy" | QSystemNetworkInfo::Busy |
"Connected" | QSystemNetworkInfo::Connected |
"Home Network" | QSystemNetworkInfo::HomeNetwork |
"Denied" | QSystemNetworkInfo::Denied |
"Roaming" | QSystemNetworkInfo::Roaming |
This property group was introduced in Mobility 1.1.
This handler is called when network MCC has changed. Note: To receive this notification, you must first call startCurrentMobileCountryCodeChanged.
This documentation was introduced in Mobility 1.1.
This handler is called when network MNC has changed. Note: To receive this notification, you must first call startCurrentMobileNetworkCodeChanged.
This documentation was introduced in Mobility 1.1.
This handler is called when the systems default network mode has changed. Note: To receive this notification, you must first call startModeChanged.
This documentation was introduced in Mobility 1.1.
This handler is called when network name has changed. Note: To receive this notification, you must first call startNameChanged.
This documentation was introduced in Mobility 1.1.
This handler is called when network signal strength has changed. Note: To receive this notification, you must first call startSignalStrengthChanged.
This documentation was introduced in Mobility 1.1.
This handler is called when network status has changed. Note: To receive this notification, you must first call startStatusChanged.
This documentation was introduced in Mobility 1.1.
QNetworkInterface NetworkInfo::interfaceForMode () |
Returns the QNetworkInterface for this NetworkInfo.
This documentation was introduced in Mobility 1.1.
© 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.