summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qtimer.cpp
diff options
context:
space:
mode:
authorAhmad Samir <a.samirh78@gmail.com>2023-07-21 20:24:09 +0300
committerAhmad Samir <a.samirh78@gmail.com>2023-07-23 01:22:06 +0300
commit794e0d1ac6b99c9398e4802b4f9e60012dcf055d (patch)
tree47128e81546e679a5cf55545313dc6f00de1038b /src/corelib/kernel/qtimer.cpp
parent9bc43ba1c69076a4107dd537e269a026c7177384 (diff)
QTimer: fix API docs of callOnTimeOut overload
It actually takes one parameter, because in this overload the connection type can't be specified, for example: QTimer timer; timer.callOnTimeout([]() { qDebug() << "slot"; }); The call chain is: QObject::connect(timer, &QTimer::timeout, functor); connect(const typename QtPrivate::FunctionPointer<Func1>::Object *sender, Func1 signal, Func2 &&slot) connect(sender, signal, sender, std::forward<Func2>(slot), Qt::DirectConnection); the connection type is always DirectConnection. Spotted by Giuseppe in code review. Pick-to: 6.6 6.5 5.15 Change-Id: Ia8bbd91e98a357244cbfae4e3ed63d4c73038fa2 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Diffstat (limited to 'src/corelib/kernel/qtimer.cpp')
-rw-r--r--src/corelib/kernel/qtimer.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/corelib/kernel/qtimer.cpp b/src/corelib/kernel/qtimer.cpp
index ea23e3e2f41..57cb0c5cd1d 100644
--- a/src/corelib/kernel/qtimer.cpp
+++ b/src/corelib/kernel/qtimer.cpp
@@ -505,14 +505,16 @@ void QTimer::singleShot(int msec, Qt::TimerType timerType, const QObject *receiv
*/
/*!
- \fn template <typename Functor> QMetaObject::Connection QTimer::callOnTimeout(Functor &&slot, Qt::ConnectionType connectionType = Qt::AutoConnection)
+ \fn template <typename Functor> QMetaObject::Connection QTimer::callOnTimeout(Functor &&slot)
\since 5.12
- Creates a connection of type \a connectionType from the timeout() signal
- to \a slot, and returns a handle to the connection.
+ Creates a connection from the timer's timeout() signal to \a slot.
+ Returns a handle to the connection.
- This method is provided for convenience.
- It's equivalent to calling \c {QObject::connect(timer, &QTimer::timeout, timer, slot, connectionType)}.
+ This method is provided for convenience. It's equivalent to calling:
+ \code
+ QObject::connect(timer, &QTimer::timeout, timer, slot, Qt::DirectConnection);
+ \endcode
\sa QObject::connect(), timeout()
*/