diff options
Diffstat (limited to 'src/corelib/kernel')
-rw-r--r-- | src/corelib/kernel/qobject.cpp | 5 | ||||
-rw-r--r-- | src/corelib/kernel/qobjectdefs_impl.h | 7 |
2 files changed, 5 insertions, 7 deletions
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index 2f4f76856f..1b05962c07 100644 --- a/src/corelib/kernel/qobject.cpp +++ b/src/corelib/kernel/qobject.cpp @@ -2653,7 +2653,8 @@ static inline void check_and_warn_compat(const QMetaObject *sender, const QMetaM call qRegisterMetaType() to register the data type before you establish the connection. - \sa disconnect(), sender(), qRegisterMetaType(), Q_DECLARE_METATYPE() + \sa disconnect(), sender(), qRegisterMetaType(), Q_DECLARE_METATYPE(), + {Differences between String-Based and Functor-Based Connections} */ QMetaObject::Connection QObject::connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, @@ -4655,6 +4656,8 @@ void qDeleteInEventHandler(QObject *o) make sure to declare the argument type with Q_DECLARE_METATYPE Overloaded functions can be resolved with help of \l qOverload. + + \sa {Differences between String-Based and Functor-Based Connections} */ /*! diff --git a/src/corelib/kernel/qobjectdefs_impl.h b/src/corelib/kernel/qobjectdefs_impl.h index bd08ca1763..3f5f2e78bb 100644 --- a/src/corelib/kernel/qobjectdefs_impl.h +++ b/src/corelib/kernel/qobjectdefs_impl.h @@ -90,14 +90,9 @@ namespace QtPrivate { explicit ApplyReturnValue(void *data_) : data(data_) {} }; template<typename T, typename U> - void operator,(const T &value, const ApplyReturnValue<U> &container) { - if (container.data) - *reinterpret_cast<U*>(container.data) = value; - } - template<typename T, typename U> void operator,(T &&value, const ApplyReturnValue<U> &container) { if (container.data) - *reinterpret_cast<U*>(container.data) = value; + *reinterpret_cast<U *>(container.data) = std::forward<T>(value); } template<typename T> void operator,(T, const ApplyReturnValue<void> &) {} |