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>
This commit is contained in:
Ahmad Samir 2023-07-08 18:46:30 +03:00
parent 15cfdab514
commit 07c34e4c79

View File

@ -50,31 +50,31 @@ public:
static void singleShot(int msec, Qt::TimerType timerType, const QObject *receiver, const char *member); static void singleShot(int msec, Qt::TimerType timerType, const QObject *receiver, const char *member);
// singleShot with context // singleShot with context
#ifdef Q_QDOC
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> template <typename Duration, typename Functor>
static inline void singleShot(Duration interval, static inline void singleShot(Duration interval,
#ifdef Q_QDOC
const QObject *receiver,
#else
const typename QtPrivate::ContextTypeForFunctor<Functor>::ContextType *receiver, const typename QtPrivate::ContextTypeForFunctor<Functor>::ContextType *receiver,
#endif
Functor &&slot) Functor &&slot)
{ {
singleShot(interval, defaultTypeFor(interval), receiver, std::forward<Functor>(slot)); singleShot(interval, defaultTypeFor(interval), receiver, std::forward<Functor>(slot));
} }
template <typename Duration, typename Functor> template <typename Duration, typename Functor>
static inline void singleShot(Duration interval, Qt::TimerType timerType, static inline void singleShot(Duration interval, Qt::TimerType timerType,
#ifdef Q_QDOC
const QObject *receiver,
#else
const typename QtPrivate::ContextTypeForFunctor<Functor>::ContextType *receiver, const typename QtPrivate::ContextTypeForFunctor<Functor>::ContextType *receiver,
#endif
Functor &&slot) Functor &&slot)
{ {
using Prototype = void(*)(); using Prototype = void(*)();
singleShotImpl(interval, timerType, receiver, singleShotImpl(interval, timerType, receiver,
QtPrivate::makeCallableObject<Prototype>(std::forward<Functor>(slot))); QtPrivate::makeCallableObject<Prototype>(std::forward<Functor>(slot)));
} }
#endif
// singleShot without context // singleShot without context
template <typename Duration, typename Functor> template <typename Duration, typename Functor>
static inline void singleShot(Duration interval, Functor &&slot) static inline void singleShot(Duration interval, Functor &&slot)