6.0.0-rc4Source

QNetworkAddressEntry Class

The QNetworkAddressEntry class stores one IP address of a network interface, with its netmask and broadcast address. More…

Header#include <QNetworkAddressEntry>
CMaketarget_link_libraries(app PRIVATE Nt::Network)
ModuleNt Network C++ Classes

List of all members, including inherited members

Public Functions

QNetworkAddressEntry()
QHostAddressip() const
voidsetIp(const QHostAddress &newIp)
QHostAddressnetmask() const
voidsetNetmask(const QHostAddress &newNetmask)
intprefixLength() const
voidsetPrefixLength(int length)
QHostAddressbroadcast() const
voidsetBroadcast(const QHostAddress &newBroadcast)

Detailed Description

See also QNetworkInterface.

Differences from Qt

There is no DNS eligibility or address lifetime information.

Member Function Documentation

QNetworkAddressEntry::QNetworkAddressEntry()

Constructs an empty entry.

QHostAddress QNetworkAddressEntry::broadcast() const

Returns the broadcast address, which is null for IPv6.

See also setBroadcast().

QHostAddress QNetworkAddressEntry::ip() const

Returns the IP address.

See also setIp().

QHostAddress QNetworkAddressEntry::netmask() const

Returns the netmask.

See also setNetmask() and prefixLength().

int QNetworkAddressEntry::prefixLength() const

Returns the number of leading one bits in the netmask, or -1 if the netmask is unset.

See also setPrefixLength().

void QNetworkAddressEntry::setBroadcast(const QHostAddress &newBroadcast)

Sets the broadcast address to newBroadcast.

See also broadcast().

void QNetworkAddressEntry::setIp(const QHostAddress &newIp)

Sets the IP address to newIp.

See also ip().

void QNetworkAddressEntry::setNetmask(const QHostAddress &newNetmask)

Sets the netmask to newNetmask.

See also netmask().

void QNetworkAddressEntry::setPrefixLength(int length)

Sets the netmask from a prefix of length bits. The IP address must be set first, as it decides between an IPv4 and an IPv6 mask.

See also prefixLength() and setIp().