From 491e427bb2d3cafccbb26d2ca3b7e128d786a564 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 6 Aug 2018 13:30:52 -0700 Subject: [PATCH] QTimer: Add const to some singleShot methods MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [ChangeLog][QtCore][QTimer] Fixed singleShot() methods that lacked proper "const" qualification to QObject context receivers. Task-number: QTBUG-69800 Change-Id: Ia741b559c24d46c78fb2fffd154865a9cb762473 Reviewed-by: Jędrzej Nowacki Reviewed-by: Olivier Goffart (Woboq GmbH) --- src/corelib/kernel/qtimer.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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;