diff options
author | Ahmad Samir <a.samirh78@gmail.com> | 2023-07-08 18:46:30 +0300 |
---|---|---|
committer | Ahmad Samir <a.samirh78@gmail.com> | 2023-08-18 19:56:30 +0300 |
commit | 07c34e4c79bd7b7f70fedbfaee327f127d224c6c (patch) | |
tree | 320a2679450fc1020c57d05f2fb6d3794ee5458e /src/corelib/kernel/qtimer.h | |
parent | 15cfdab514591a66ffa783e5d680926578b9d05b (diff) |
QTimer: put #ifdef qdoc related-lines in one block
Slightly more readable.
Change-Id: Ib945319b4f7606a0796e8ac09f6659e63b7291df
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/kernel/qtimer.h')
-rw-r--r-- | src/corelib/kernel/qtimer.h | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/corelib/kernel/qtimer.h b/src/corelib/kernel/qtimer.h index b01cfdec9a..254e4cd993 100644 --- a/src/corelib/kernel/qtimer.h +++ b/src/corelib/kernel/qtimer.h @@ -50,31 +50,31 @@ public: static void singleShot(int msec, Qt::TimerType timerType, const QObject *receiver, const char *member); // singleShot with context - template <typename Duration, typename Functor> - static inline void singleShot(Duration interval, #ifdef Q_QDOC - const QObject *receiver, + template <typename Duration, typename Functor> + static inline void singleShot(Duration interval, const QObject *receiver, Functor &&slot); + template <typename Duration, typename Functor> + static inline void singleShot(Duration interval, Qt::TimerType timerType, + const QObject *receiver, Functor &&slot); #else + template <typename Duration, typename Functor> + static inline void singleShot(Duration interval, const typename QtPrivate::ContextTypeForFunctor<Functor>::ContextType *receiver, -#endif - Functor &&slot) { singleShot(interval, defaultTypeFor(interval), receiver, std::forward<Functor>(slot)); } 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<Functor>::ContextType *receiver, -#endif Functor &&slot) { using Prototype = void(*)(); singleShotImpl(interval, timerType, receiver, QtPrivate::makeCallableObject<Prototype>(std::forward<Functor>(slot))); } +#endif + // singleShot without context template <typename Duration, typename Functor> static inline void singleShot(Duration interval, Functor &&slot) |