Home · All Namespaces · All Classes · Grouped Classes · Modules · Functions codeless banner

Identity Class Reference
(QNetworkConnection::Identity)
[QtBaseModule]

The Identity class provides an identifier for a network connection. More...

Public Functions


Detailed Description

The Identity class provides an identifier for a network connection.

As a physical network device can potentially connect to a variety of remote networks (usually just determined by a set of configuration parameter such as a WLAN ESSID), QNetworkConnection::Identity allows to uniquely distinguish network connections in a device independent manor.

Most network connections such as LAN and all types of dial-up connections do not support more than one network connection per network device. The two types of network devices that support multiple network connections are:

Each network connection has a user visible name(), is associated to a deviceHandle() which identifies the network device and a type(). The following example deomstrates the most common way how network identities are obtain:

    QNetworkConnectionManager manager;
    QNetworkConnection::Identities idents = manager.connections();
    QNetworkDevice dev( idents.at(0) ); //pick first
    QtopiaNetworkInterface::Status state = dev.state();

For more information about the Qt Extended network API see QNetworkDevice.

See also QNetworkConnection.


Member Function Documentation

Identity::Identity ()

Creates an invalid identity.

Identity::Identity ( const Identity & other )

Constructs a copy of other.

Identity::~Identity ()

Destroys this QNetworkConnection::Identity instance.

QString Identity::deviceHandle () const

Returns the handle for this network connection. The handle allows the identification of the network device associated to this identity.

Note: Several identities can have the same handle such as wireless LAN or Bluetooth PAN connections which can be managed by the same network device. This means that no two network connections with the same identity handle can be online/connected at the same time.

bool Identity::isValid () const

Returns true if this Identity object can be mapped to a valid network configuration.

A network connection identity becomes invalid when the associated network configuration is deleted.

Note: note The network connection identity remains the same if the configuration has been edited only. This means that the actual target network and/or the name (as returned by QNetworkConnection::Identity::name() ) may change during the life time of this object.

QString Identity::name () const

Returns the user visibile name of the network connection. The returned name is empty if this identity is invalid.

See also isValid().

QtopiaNetwork::Type Identity::type () const

Returns the network connection type. An invalid identity returns QtopiaNetwork::Any;

bool Identity::operator!= ( const Identity & other ) const

Returns true if this identityis is not equal to other. Equality means all the fields are equivalent.

Identity & Identity::operator= ( const Identity & other )

Assings other to this

bool Identity::operator== ( const Identity & other ) const

Returns true if this identityis equal to other. Equality means all the fields are equivalent.


Copyright © 2009 Nokia Trademarks
Qt Extended 4.4.3