Skip to content

PythonQt.QtNetwork.QHostAddress

QHostAddress

PythonQtInstanceWrapper object

Native bases: PythonQtInstanceWrapper

Supplemental documentation: Qt 5 reference:

Detailed Description

This class holds an IPv4 or IPv6 address in a platform- and protocol-independent manner.

QHostAddress is normally used with the QTcpSocket, QTcpServer, and QUdpSocket to connect to a host or to set up a server.

A host address is set with setAddress(), and retrieved with toIPv4Address(), toIPv6Address(), or toString(). You can check the type with protocol().

Note: Please note that QHostAddress does not do DNS lookups. QHostInfo is needed for that.

The class also supports common predefined addresses: Null, LocalHost, LocalHostIPv6, Broadcast, and Any.

Source: https://doc.qt.io/archives/qt-5.15/qhostaddress.html

Complete member index

Every captured member retains its own identity. Identical captured declaration text is linked once; this does not establish native inheritance or interchangeable objects.

Member Kind Signature Summary
Any attribute Any (shared captured text)
AnyIPv4 attribute Any
AnyIPv6 attribute Any
Broadcast attribute Any
LocalHost attribute Any
LocalHostIPv6 attribute Any
Null attribute Any (shared captured text)
SpecialAddress attribute type Convert a number or string to an integer, or return 0 if no arguments are given.
__init__ function (self, *args: Any, **kwargs: Any) -> None Native constructor; consult class documentation for supported overloads. (shared captured text)
className function (self, *args: Any, **kwargs: Any) -> Any Return the classname of the object (shared captured text)
clear function (self) -> None Sets the host address to null and sets the protocol to [QAbstractSocket::UnknownNetworkLayerProtocol](https://doc.qt.io/archives/qt-5.15/qabstractsocket.html#NetworkLayerProtocol-enum).
delete function (self, *args: Any, **kwargs: Any) -> Any Deletes the C++ object (at your own risk, my friend!) (shared captured text)
help function (self, *args: Any, **kwargs: Any) -> Any Shows the help of available methods for this class (shared captured text)
inherits function (self, *args: Any, **kwargs: Any) -> Any Returns if the class inherits or is of given type name (shared captured text)
isInSubnet function (self, subnet: Any, netmask: Any) -> bool X.isInSubnet(subnet, netmask) -> bool
isLoopback function (self) -> bool X.isLoopback() -> bool
isMulticast function (self) -> bool X.isMulticast() -> bool
isNull function (self) -> bool X.isNull() -> bool
parseSubnet function (self, subnet: str) -> Any Parses the IP and subnet information contained in subnet and returns the network prefix for that network and its prefix length.
protocol function (self) -> Any Returns the network layer protocol of the host address.
readFrom function (self, arg__1: Any) -> Any (shared captured text)
scopeId function (self) -> str X.scopeId() -> str
setAddress function (self, ip6Addr: Any) -> Any Set the IPv4 address specified by ip4Addr.
setScopeId function (self, id: str) -> None Sets the IPv6 scope ID of the address to id.
swap function (self, other: Any) -> None Swaps this host address with other.
toIPv4Address function (self, ok: Any) -> int X.toIPv4Address(ok) -> int
toIPv6Address function (self) -> Any X.toIPv6Address() -> PythonQt.QtNetwork.QIPv6Address
toString function (self) -> str X.toString() -> str
writeTo function (self, arg__1: Any) -> Any (shared captured text)