diff options
| author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2023-05-03 15:09:32 +0200 |
|---|---|---|
| committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2023-05-04 10:33:27 +0200 |
| commit | 1af36eb230da4cde7a8ce4addb9f4772922b7fa4 (patch) | |
| tree | a4ba945b273bfa8abea162e4dee0de4e48796c7c /src/corelib/kernel/qtimer.cpp | |
| parent | 178c123a6fa217f26f3f2be25f3495d01d1ca386 (diff) | |
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 <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/kernel/qtimer.cpp')
| -rw-r--r-- | src/corelib/kernel/qtimer.cpp | 29 |
1 files changed, 8 insertions, 21 deletions
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<typename Functor> void QTimer::singleShot(int msec, const QObject *context, Functor &&functor) - \fn template<typename Functor> void QTimer::singleShot(int msec, Qt::TimerType timerType, const QObject *context, Functor &&functor) - \fn template<typename Functor> void QTimer::singleShot(int msec, Functor &&functor) - \fn template<typename Functor> void QTimer::singleShot(int msec, Qt::TimerType timerType, Functor &&functor) +/*! \fn template<typename Duration, typename Functor> void QTimer::singleShot(Duration msec, const QObject *context, Functor &&functor) + \fn template<typename Duration, typename Functor> void QTimer::singleShot(Duration msec, Qt::TimerType timerType, const QObject *context, Functor &&functor) + \fn template<typename Duration, typename Functor> void QTimer::singleShot(Duration msec, Functor &&functor) + \fn template<typename Duration, typename Functor> 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 <typename Functor> QMetaObject::Connection QTimer::callOnTimeout(Functor slot, Qt::ConnectionType connectionType = Qt::AutoConnection) + \fn template <typename Functor> 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 <typename Functor> QMetaObject::Connection QTimer::callOnTimeout(const QObject *context, Functor slot, Qt::ConnectionType connectionType = Qt::AutoConnection) + \fn template <typename Functor> QMetaObject::Connection QTimer::callOnTimeout(const QObject *context, Functor &&slot, Qt::ConnectionType connectionType = Qt::AutoConnection) \since 5.12 \overload callOnTimeout() @@ -531,20 +532,6 @@ void QTimer::singleShot(int msec, Qt::TimerType timerType, const QObject *receiv */ /*! - \fn template <typename MemberFunction> 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 \overload |
