path: root/src/network/kernel/qhostaddress.h
diff options
authorThiago Macieira <>2014-12-24 15:43:08 -0200
committerThiago Macieira <>2015-03-06 07:53:59 +0000
commit775d04f97ec1723c01c12f8faab05236686b9b05 (patch)
treeb1481664428dd47abe58b0c9763d137d70a9f6b9 /src/network/kernel/qhostaddress.h
parentab8d36d6f36119dc9ef211acc391d8c2bfb5ee83 (diff)
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 Change-Id: I637fe55583f2255c85b0d955e5886b61494e0c7c Reviewed-by: Richard J. Moore <>
Diffstat (limited to 'src/network/kernel/qhostaddress.h')
1 files changed, 2 insertions, 1 deletions
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;