diff --git a/src/corelib/kernel/qtimer.h b/src/corelib/kernel/qtimer.h index 7825bb0798..f5c04c7f70 100644 --- a/src/corelib/kernel/qtimer.h +++ b/src/corelib/kernel/qtimer.h @@ -141,14 +141,14 @@ public: template static inline typename std::enable_if::IsPointerToMemberFunction && !std::is_same::value, void>::type - singleShot(Duration interval, QObject *context, Func1 slot) + singleShot(Duration interval, const QObject *context, Func1 slot) { singleShot(interval, defaultTypeFor(interval), context, std::move(slot)); } template static inline typename std::enable_if::IsPointerToMemberFunction && !std::is_same::value, void>::type - singleShot(Duration interval, Qt::TimerType timerType, QObject *context, Func1 slot) + singleShot(Duration interval, Qt::TimerType timerType, const QObject *context, Func1 slot) { //compilation error if the slot has arguments. typedef QtPrivate::FunctionPointer SlotType;