From 9d918495ee56dca5826070df888d20adfcc29641 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Sat, 22 Apr 2017 13:21:28 +0200 Subject: Add a few std::move in functions accepting slots This allows the use of move-only function objects Task-number: QTBUG-60339 Change-Id: If3595fca338cf7f3039eb566cc02e4e73cd04c86 Reviewed-by: Thiago Macieira --- src/corelib/kernel/qtimer.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/corelib/kernel/qtimer.h') diff --git a/src/corelib/kernel/qtimer.h b/src/corelib/kernel/qtimer.h index 6e61ca10cb..7db5fc759b 100644 --- a/src/corelib/kernel/qtimer.h +++ b/src/corelib/kernel/qtimer.h @@ -122,14 +122,14 @@ public: !std::is_same::value, void>::type singleShot(Duration interval, Func1 slot) { - singleShot(interval, defaultTypeFor(interval), nullptr, slot); + singleShot(interval, defaultTypeFor(interval), nullptr, std::move(slot)); } template static inline typename std::enable_if::IsPointerToMemberFunction && !std::is_same::value, void>::type singleShot(Duration interval, Qt::TimerType timerType, Func1 slot) { - singleShot(interval, timerType, nullptr, slot); + singleShot(interval, timerType, nullptr, std::move(slot)); } // singleShot to a functor or function pointer (with context) template @@ -137,7 +137,7 @@ public: !std::is_same::value, void>::type singleShot(Duration interval, QObject *context, Func1 slot) { - singleShot(interval, defaultTypeFor(interval), context, slot); + singleShot(interval, defaultTypeFor(interval), context, std::move(slot)); } template static inline typename std::enable_if::IsPointerToMemberFunction && @@ -150,7 +150,7 @@ public: singleShotImpl(interval, timerType, context, new QtPrivate::QFunctorSlotObject::Value, void>(slot)); + typename QtPrivate::List_Left::Value, void>(std::move(slot))); } #endif -- cgit v1.2.3