The problem might be that an if else still expects the function QHostAddress::AnyIPv4 to exist during compile right?
As that is the case with C# at least because during compile it runs thru and checks against its included libraries (Qt4 or Qt5 in this case) and if they don't exist it breaks, workaround would be 2 branches for the different Qt versions but believe we are only gonna support Qt5 in upcoming releases.
It's still a bug in Qt5 as well which has yet to be fixed according to their bug tracker, normally ::Any should not fail if an IPv6 interface isn't usable / non-existent (fallback to IPv4) as that's how it works under Java / .NET atm