diff --git a/src/network/compat/removed_api.cpp b/src/network/compat/removed_api.cpp index 969ad9cd3be..956018cece0 100644 --- a/src/network/compat/removed_api.cpp +++ b/src/network/compat/removed_api.cpp @@ -9,6 +9,16 @@ QT_USE_NAMESPACE #if QT_NETWORK_REMOVED_SINCE(6, 7) +#include "qhostinfo.h" + +// static +int QHostInfo::lookupHost(const QString &name, QObject *receiver, const char *member) +{ + const auto *r = receiver; + return lookupHost(name, r, member); +} + + #include "qnetworkreply.h" QByteArray QNetworkReply::rawHeader(const QByteArray &headerName) const diff --git a/src/network/kernel/qhostinfo.cpp b/src/network/kernel/qhostinfo.cpp index 99ed32b8034..62bb210ca17 100644 --- a/src/network/kernel/qhostinfo.cpp +++ b/src/network/kernel/qhostinfo.cpp @@ -221,9 +221,12 @@ static int nextId() \note There is no guarantee on the order the signals will be emitted if you start multiple requests with lookupHost(). + \note In Qt versions prior to 6.7, this function took \a receiver as + (non-const) \c{QObject*}. + \sa abortHostLookup(), addresses(), error(), fromName() */ -int QHostInfo::lookupHost(const QString &name, QT7_ONLY(const) QObject *receiver, const char *member) +int QHostInfo::lookupHost(const QString &name, const QObject *receiver, const char *member) { if (!receiver || !member) { qWarning("QHostInfo::lookupHost: both the receiver and the member to invoke must be non-null"); diff --git a/src/network/kernel/qhostinfo.h b/src/network/kernel/qhostinfo.h index 12a2db7e8b7..e338a0b6d56 100644 --- a/src/network/kernel/qhostinfo.h +++ b/src/network/kernel/qhostinfo.h @@ -48,7 +48,10 @@ public: void setLookupId(int id); int lookupId() const; - static int lookupHost(const QString &name, QT7_ONLY(const) QObject *receiver, const char *member); +#if QT_NETWORK_REMOVED_SINCE(6, 7) + static int lookupHost(const QString &name, QObject *receiver, const char *member); +#endif + static int lookupHost(const QString &name, const QObject *receiver, const char *member); static void abortHostLookup(int lookupId); static QHostInfo fromName(const QString &name);