summaryrefslogtreecommitdiffstats
path: root/src/network/kernel
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2024-01-23 14:19:59 +0100
committerMarc Mutz <marc.mutz@qt.io>2024-01-23 19:08:23 +0100
commit4b3d6be5f5a175a4c66b527eb2df49d62dc30056 (patch)
treef8ecf2dffb9fe325252230bf0aa10e973e4f7960 /src/network/kernel
parent081e50d768114aeeb8f0d284989986d4debc6ec3 (diff)
QHostInfo: fix lookupHost() signature immediately
... and not just for Qt 7. Found in API-Review. Amends dd50d58af267bd3b79d1ca31b920d72b925d5a37. [ChangeLog][QtNetwork][QHostInfo] The lookupHost() static function now takes const QObject* receivers (was: (non-const) QObject*). Pick-to: 6.7 Change-Id: I22b11e06cfba4e96975239cabed8b379cf3f4fa4 Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src/network/kernel')
-rw-r--r--src/network/kernel/qhostinfo.cpp5
-rw-r--r--src/network/kernel/qhostinfo.h5
2 files changed, 8 insertions, 2 deletions
diff --git a/src/network/kernel/qhostinfo.cpp b/src/network/kernel/qhostinfo.cpp
index 99ed32b803..62bb210ca1 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 12a2db7e8b..e338a0b6d5 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);