From 1af36eb230da4cde7a8ce4addb9f4772922b7fa4 Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Wed, 3 May 2023 15:09:32 +0200 Subject: Doc: fix warnings in QTimer Amends recent changes that added std::chrono support by making the duration type of QTimer::singleShot a template parameter. Change-Id: If3b5f0ad99304cb292412bb8467ba6852e47654f Reviewed-by: Thiago Macieira --- src/corelib/kernel/qtimer.cpp | 29 ++++++++--------------------- 1 file changed, 8 insertions(+), 21 deletions(-) (limited to 'src/corelib/kernel/qtimer.cpp') diff --git a/src/corelib/kernel/qtimer.cpp b/src/corelib/kernel/qtimer.cpp index 2e7382d051e..a1abe710529 100644 --- a/src/corelib/kernel/qtimer.cpp +++ b/src/corelib/kernel/qtimer.cpp @@ -441,10 +441,10 @@ void QTimer::singleShot(int msec, Qt::TimerType timerType, const QObject *receiv } } -/*! \fn template void QTimer::singleShot(int msec, const QObject *context, Functor &&functor) - \fn template void QTimer::singleShot(int msec, Qt::TimerType timerType, const QObject *context, Functor &&functor) - \fn template void QTimer::singleShot(int msec, Functor &&functor) - \fn template void QTimer::singleShot(int msec, Qt::TimerType timerType, Functor &&functor) +/*! \fn template void QTimer::singleShot(Duration msec, const QObject *context, Functor &&functor) + \fn template void QTimer::singleShot(Duration msec, Qt::TimerType timerType, const QObject *context, Functor &&functor) + \fn template void QTimer::singleShot(Duration msec, Functor &&functor) + \fn template void QTimer::singleShot(Duration msec, Qt::TimerType timerType, Functor &&functor) \since 5.4 \reentrant @@ -462,6 +462,8 @@ void QTimer::singleShot(int msec, Qt::TimerType timerType, const QObject *receiv If \a functor is a member function of \a context, then the function will be called on the object. + The \a msec parameter can be an \c int or a \c std::chrono::milliseconds value. + \sa start() */ @@ -503,9 +505,8 @@ void QTimer::singleShot(int msec, Qt::TimerType timerType, const QObject *receiv */ /*! - \fn template QMetaObject::Connection QTimer::callOnTimeout(Functor slot, Qt::ConnectionType connectionType = Qt::AutoConnection) + \fn template QMetaObject::Connection QTimer::callOnTimeout(Functor &&slot, Qt::ConnectionType connectionType = Qt::AutoConnection) \since 5.12 - \overload Creates a connection of type \a connectionType from the timeout() signal to \a slot, and returns a handle to the connection. @@ -517,7 +518,7 @@ void QTimer::singleShot(int msec, Qt::TimerType timerType, const QObject *receiv */ /*! - \fn template QMetaObject::Connection QTimer::callOnTimeout(const QObject *context, Functor slot, Qt::ConnectionType connectionType = Qt::AutoConnection) + \fn template QMetaObject::Connection QTimer::callOnTimeout(const QObject *context, Functor &&slot, Qt::ConnectionType connectionType = Qt::AutoConnection) \since 5.12 \overload callOnTimeout() @@ -530,20 +531,6 @@ void QTimer::singleShot(int msec, Qt::TimerType timerType, const QObject *receiv \sa QObject::connect(), timeout() */ -/*! - \fn template QMetaObject::Connection QTimer::callOnTimeout(const QObject *receiver, MemberFunction *slot, Qt::ConnectionType connectionType = Qt::AutoConnection) - \since 5.12 - \overload callOnTimeout() - - Creates a connection from the timeout() signal to the \a slot in the \a receiver object. Returns - a handle to the connection. - - This method is provided for convenience. It's equivalent to calling - \c {QObject::connect(timer, &QTimer::timeout, receiver, slot, connectionType)}. - - \sa QObject::connect(), timeout() -*/ - /*! \fn void QTimer::start(std::chrono::milliseconds msec) \since 5.8 -- cgit v1.2.3