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.h | |
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.h')
-rw-r--r-- | src/corelib/kernel/qtimer.h | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/corelib/kernel/qtimer.h b/src/corelib/kernel/qtimer.h index 829d58a7c2..4c70ab2562 100644 --- a/src/corelib/kernel/qtimer.h +++ b/src/corelib/kernel/qtimer.h @@ -50,41 +50,41 @@ public: static void singleShot(int msec, Qt::TimerType timerType, const QObject *receiver, const char *member); // singleShot with context - template <typename Duration, typename Func1> + template <typename Duration, typename Functor> static inline void singleShot(Duration interval, #ifdef Q_QDOC const QObject *receiver, #else - const typename QtPrivate::ContextTypeForFunctor<Func1>::ContextType *receiver, + const typename QtPrivate::ContextTypeForFunctor<Functor>::ContextType *receiver, #endif - Func1 &&slot) + Functor &&slot) { - singleShot(interval, defaultTypeFor(interval), receiver, std::forward<Func1>(slot)); + singleShot(interval, defaultTypeFor(interval), receiver, std::forward<Functor>(slot)); } - template <typename Duration, typename Func1> + template <typename Duration, typename Functor> static inline void singleShot(Duration interval, Qt::TimerType timerType, #ifdef Q_QDOC const QObject *receiver, #else - const typename QtPrivate::ContextTypeForFunctor<Func1>::ContextType *receiver, + const typename QtPrivate::ContextTypeForFunctor<Functor>::ContextType *receiver, #endif - Func1 &&slot) + Functor &&slot) { using Prototype = void(*)(); singleShotImpl(interval, timerType, receiver, - QtPrivate::makeSlotObject<Prototype>(std::forward<Func1>(slot))); + QtPrivate::makeSlotObject<Prototype>(std::forward<Functor>(slot))); } // singleShot without context - template <typename Duration, typename Func1> - static inline void singleShot(Duration interval, Func1 &&slot) + template <typename Duration, typename Functor> + static inline void singleShot(Duration interval, Functor &&slot) { - singleShot(interval, defaultTypeFor(interval), nullptr, std::forward<Func1>(slot)); + singleShot(interval, defaultTypeFor(interval), nullptr, std::forward<Functor>(slot)); } - template <typename Duration, typename Func1> - static inline void singleShot(Duration interval, Qt::TimerType timerType, Func1 &&slot) + template <typename Duration, typename Functor> + static inline void singleShot(Duration interval, Qt::TimerType timerType, Functor &&slot) { - singleShot(interval, timerType, nullptr, std::forward<Func1>(slot)); + singleShot(interval, timerType, nullptr, std::forward<Functor>(slot)); } #ifdef Q_QDOC |