From 775d04f97ec1723c01c12f8faab05236686b9b05 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 24 Dec 2014 15:43:08 -0200 Subject: Add a QHostAddress::toIPv4Address overload taking a bool *ok This allows one to check whether the conversion is successful without checking for the return result, as the value of 0 represents the valid IPv4 address 0.0.0.0. Change-Id: I637fe55583f2255c85b0d955e5886b61494e0c7c Reviewed-by: Richard J. Moore --- src/network/kernel/qhostaddress.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/network/kernel/qhostaddress.h') diff --git a/src/network/kernel/qhostaddress.h b/src/network/kernel/qhostaddress.h index 93d64ff54a..de3a79278e 100644 --- a/src/network/kernel/qhostaddress.h +++ b/src/network/kernel/qhostaddress.h @@ -93,7 +93,8 @@ public: bool setAddress(const QString &address); QAbstractSocket::NetworkLayerProtocol protocol() const; - quint32 toIPv4Address() const; + quint32 toIPv4Address() const; // ### Qt6: merge with next overload + quint32 toIPv4Address(bool *ok) const; Q_IPV6ADDR toIPv6Address() const; QString toString() const; -- cgit v1.2.3