diff options
Diffstat (limited to 'src/network/kernel/qhostinfo.h')
-rw-r--r-- | src/network/kernel/qhostinfo.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/network/kernel/qhostinfo.h b/src/network/kernel/qhostinfo.h index 4484d718bd..c5727bb6eb 100644 --- a/src/network/kernel/qhostinfo.h +++ b/src/network/kernel/qhostinfo.h @@ -63,8 +63,11 @@ public: explicit QHostInfo(int lookupId = -1); QHostInfo(const QHostInfo &d); QHostInfo &operator=(const QHostInfo &d); + QHostInfo &operator=(QHostInfo &&other) Q_DECL_NOTHROW { swap(other); return *this; } ~QHostInfo(); + void swap(QHostInfo &other) Q_DECL_NOTHROW { qSwap(d, other.d); } + QString hostName() const; void setHostName(const QString &name); @@ -125,7 +128,7 @@ public: !std::is_same<const char *, Func>::value, int>::type lookupHost(const QString &name, Func slot) { - return lookupHost(name, nullptr, slot); + return lookupHost(name, nullptr, std::move(slot)); } // lookupHost to a functor or function pointer (with context) @@ -141,7 +144,7 @@ public: auto slotObj = new QtPrivate::QFunctorSlotObject<Func1, 1, typename QtPrivate::List<QHostInfo>, - void>(slot); + void>(std::move(slot)); return lookupHostImpl(name, context, slotObj); } #endif // Q_QDOC @@ -154,6 +157,8 @@ private: QtPrivate::QSlotObjectBase *slotObj); }; +Q_DECLARE_SHARED_NOT_MOVABLE_UNTIL_QT6(QHostInfo) + QT_END_NAMESPACE Q_DECLARE_METATYPE(QHostInfo) |