From 4367abb75a8ce07344006efd17317d5ad8e03f5f Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Mon, 4 Sep 2023 20:14:57 +0200 Subject: [PATCH] QHostInfo::lookupHost: enable QT_NO_CONTEXTLESS_CONNECT QHostInfo::lookupHost uses some QObject private APIs in order to have a invoke a slot/function when the lookup is finished. The overload that simply takes a function (and not a context object) was still available even under QT_NO_CONTEXTLESS_CONNECT, because indeed the implementation bypasses the public QObject::connect API. Hence, explicitly the overload that doesn't take a context object. Change-Id: Ibf5b0efc49b7f9c8d045862ae061f4e05ee1b769 Reviewed-by: Thiago Macieira --- src/network/kernel/qhostinfo.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/network/kernel/qhostinfo.h b/src/network/kernel/qhostinfo.h index 600e97d80af..b4b66f43fe2 100644 --- a/src/network/kernel/qhostinfo.h +++ b/src/network/kernel/qhostinfo.h @@ -73,12 +73,14 @@ public: } #endif // Q_QDOC +#ifndef QT_NO_CONTEXTLESS_CONNECT // lookupHost to a callable (without context) template static inline int lookupHost(const QString &name, Functor &&slot) { return lookupHost(name, nullptr, std::forward(slot)); } +#endif // QT_NO_CONTEXTLESS_CONNECT private: QHostInfoPrivate *d_ptr;