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)