Since 5.9 (
QTBUG-56424, ChangeId I49053ac2859e6c6c07e4a704b8b5f0d6a2d0b8a4) additional overloads for QHostInfo::lookupHost have been introduced.
Looks like those don't work as expected.
I would have expected that by specifying a QObject as a receiver context
a) it should be safe when the receiver no longer exists when a result is available
b) the slot or functor should be invoked in the receiver's thread.
Quoting the documentation "If context is destroyed before the lookup completes, the functor will not be called. The functor will be run in the thread of context. The context's thread must have a running Qt event loop."
Both my assumption seem to be wrong. The following example demonstrates the problem.
I would have expected that both invocations behave exactly the same, however only the old connect-syntax actually works.