summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qobject.cpp
diff options
context:
space:
mode:
authorFabian Kosmale <fabian.kosmale@qt.io>2025-06-16 10:26:55 +0200
committerFabian Kosmale <fabian.kosmale@qt.io>2025-06-30 11:25:07 +0200
commitc3ef55ccd3db56ab9b4023c1b423ed46855824df (patch)
treed840ee0c4d817ebfa9daabd24ff93c6d3ae6d9cb /src/corelib/kernel/qobject.cpp
parent10d46c19c5be3430415eeb8463f1853e3b838683 (diff)
QMetaObject::connect: Fix documentation copy-paste mistake
The whole point of the new functions is to support QMetaMethods as the signal argument, but the documentation still talked about PMFs. Also mention that signal needs to be indeed a signal. Pick-to: 6.10 Change-Id: I7d9d307f68d3f1df2fbaff0dfe2a5a80d4b7c2be Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Diffstat (limited to 'src/corelib/kernel/qobject.cpp')
-rw-r--r--src/corelib/kernel/qobject.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp
index 46f2ad7d1c4..38ded8117c0 100644
--- a/src/corelib/kernel/qobject.cpp
+++ b/src/corelib/kernel/qobject.cpp
@@ -3912,7 +3912,7 @@ void QMetaObject::connectSlotsByName(QObject *o)
/*!
\fn template<typename PointerToMemberFunction> QMetaObject::Connection QMetaObject::connect(
- const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type)
+ const QObject *sender, const QMetaMethod &signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type)
\threadsafe
\overload connect()
@@ -3937,13 +3937,15 @@ void QMetaObject::connectSlotsByName(QObject *o)
conversions and type checking are not handled by this function.
Overloaded slots need to be explicitly be resolved with
help of \l qOverload.
+ \a signal needs to be the meta-method of a signal, otherwise an
+ invalid connection will be returned.
\sa QObject::connect(), QObject::disconnect()
*/
/*!
- \fn template<typename PointerToMemberFunction, typename Functor> QMetaObject::Connection QMetaObject::connect(
- const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type)
+ \fn template<typename Functor> QMetaObject::Connection QMetaObject::connect(
+ const QObject *sender, const QMetaMethod &signal, const QObject *context, Functor functor, Qt::ConnectionType type)
\threadsafe
\overload connect()
@@ -3967,6 +3969,8 @@ void QMetaObject::connectSlotsByName(QObject *o)
conversions and type checking are not handled by this function.
Overloaded functors need to be explicitly be resolved with
help of \l qOverload.
+ \a signal needs to be the meta-method of a signal, otherwise an
+ invalid connection will be returned.
The connection will automatically disconnect if the sender or
the context is destroyed.