QHostAddress Class Reference |
Constant | Value | Description |
---|---|---|
QHostAddress::Null | 0 | The null address object. Equivalent to QHostAddress(). |
QHostAddress::LocalHost | 2 | The IPv4 localhost address. Equivalent to QHostAddress("127.0.0.1"). |
QHostAddress::LocalHostIPv6 | 3 | The IPv6 localhost address. Equivalent to QHostAddress("::1"). |
QHostAddress::Broadcast | 1 | The IPv4 broadcast address. Equivalent to QHostAddress("255.255.255.255"). |
QHostAddress::Any | 4 | The IPv4 any-address. Equivalent to QHostAddress("0.0.0.0"). |
QHostAddress::AnyIPv6 | 5 | The IPv6 any-address. Equivalent to QHostAddress("::"). |
Constructs a host address object with the IP address 0.0.0.0.
See also clear().
Constructs a host address object with the IPv4 address ip4Addr.
Constructs a host address object with the IPv6 address ip6Addr.
ip6Addr must be a 16-byte array in network byte order (big endian).
Constructs a host address object with the IPv6 address ip6Addr.
Constructs an IPv4 or IPv6 address based on the string address (e.g., "127.0.0.1").
See also setAddress().
Constructs a copy of the given address.
Constructs a QHostAddress object for address.
Destroys the host address object.
Sets the host address to 0.0.0.0.
Returns true if this host address is null (INADDR_ANY or in6addr_any). The default constructor creates a null address, and that address is not valid for any host or interface.
Returns the network layer protocol of the host address.
Set the IPv4 address specified by ip4Addr.
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
Set the IPv6 address specified by ip6Addr.
ip6Addr must be an array of 16 bytes in network byte order (high-order byte first).
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
Set the IPv6 address specified by ip6Addr.
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
Sets the IPv4 or IPv6 address specified by the string representation specified by address (e.g. "127.0.0.1"). Returns true and sets the address if the address was successfully parsed; otherwise returns false.
Returns the IPv4 address as a number.
For example, if the address is 127.0.0.1, the returned value is 2130706433 (i.e. 0x7f000001).
This value is only valid if isIp4Addr() returns true.
See also toString().
Returns the IPv6 address as a Q_IPV6ADDR structure. The structure consists of 16 unsigned characters.
Q_IPV6ADDR addr = hostAddr.ip6Addr(); // addr contains 16 unsigned characters for (int i = 0; i < 16; ++i) { // process addr[i] }
This value is only valid if isIPv6Address() returns true.
See also toString().
Returns the address as a string.
For example, if the address is the IPv4 address 127.0.0.1, the returned string is "127.0.0.1".
See also toIPv4Address().
Assigns another host address to this object, and returns a reference to this object.
Returns true if this host address is the same as the other address given; otherwise returns false.
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
Returns true if this host address is the same as the other address given; otherwise returns false.
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 4.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 ! |
Copyright © 2000-2012 - www.developpez.com