QTimer: Force a compilation error with pmf without object
None of this should compile (foo is non-static): QTimer::singleShot(0, &TestObject::foo); QTimer::singleShot(0, SLOT(foo())); Task-number: QTBUG-47426 Change-Id: I54b7d14124459e450c6a0a93a3033f21b57605d9 Reviewed-by: Dario Freddi <dario.freddi@ispirata.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
a1bfa39651
commit
4c3c6bab30
@ -102,12 +102,16 @@ public:
|
||||
}
|
||||
// singleShot to a functor or function pointer (without context)
|
||||
template <typename Func1>
|
||||
static inline void singleShot(int msec, Func1 slot)
|
||||
static inline typename QtPrivate::QEnableIf<!QtPrivate::FunctionPointer<Func1>::IsPointerToMemberFunction &&
|
||||
!QtPrivate::is_same<const char*, Func1>::value, void>::Type
|
||||
singleShot(int msec, Func1 slot)
|
||||
{
|
||||
singleShot(msec, msec >= 2000 ? Qt::CoarseTimer : Qt::PreciseTimer, Q_NULLPTR, slot);
|
||||
}
|
||||
template <typename Func1>
|
||||
static inline void singleShot(int msec, Qt::TimerType timerType, Func1 slot)
|
||||
static inline typename QtPrivate::QEnableIf<!QtPrivate::FunctionPointer<Func1>::IsPointerToMemberFunction &&
|
||||
!QtPrivate::is_same<const char*, Func1>::value, void>::Type
|
||||
singleShot(int msec, Qt::TimerType timerType, Func1 slot)
|
||||
{
|
||||
singleShot(msec, timerType, Q_NULLPTR, slot);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user