From ff6f01c6b5126be90d56f368de9e7b3d77820f8b Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Tue, 3 Nov 2020 23:07:38 +0000 Subject: [PATCH] Pre Qt v5.11 compatibility --- qt_helpers.hpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/qt_helpers.hpp b/qt_helpers.hpp index 7170bda0b..034a8852f 100644 --- a/qt_helpers.hpp +++ b/qt_helpers.hpp @@ -117,6 +117,16 @@ namespace std } #endif +inline +bool is_broadcast_address (QHostAddress const& host_addr) +{ +#if QT_VERSION >= 0x051100 + return host_addr.isBroadcast (); +#else + bool ok; + return host_addr.toIPv4Address (&ok) == 0xffffffffu && ok; +#endif +} inline bool is_multicast_address (QHostAddress const& host_addr)