diff options
author | Olivier Goffart <ogoffart@woboq.com> | 2017-04-22 13:21:28 +0200 |
---|---|---|
committer | Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> | 2017-04-29 08:24:24 +0000 |
commit | 9d918495ee56dca5826070df888d20adfcc29641 (patch) | |
tree | f747852109c01af142ca8fe2e100c13a0c690247 /src/corelib/kernel/qtimer.h | |
parent | a6c091c2d18f6e7f849da7dfa3bd1971017fca73 (diff) |
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 <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/kernel/qtimer.h')
-rw-r--r-- | src/corelib/kernel/qtimer.h | 8 |
1 files changed, 4 insertions, 4 deletions
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<const char*, Func1>::value, void>::type singleShot(Duration interval, Func1 slot) { - singleShot(interval, defaultTypeFor(interval), nullptr, slot); + singleShot(interval, defaultTypeFor(interval), nullptr, std::move(slot)); } template <typename Duration, typename Func1> static inline typename std::enable_if<!QtPrivate::FunctionPointer<Func1>::IsPointerToMemberFunction && !std::is_same<const char*, Func1>::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 <typename Duration, typename Func1> @@ -137,7 +137,7 @@ public: !std::is_same<const char*, Func1>::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 <typename Duration, typename Func1> static inline typename std::enable_if<!QtPrivate::FunctionPointer<Func1>::IsPointerToMemberFunction && @@ -150,7 +150,7 @@ public: singleShotImpl(interval, timerType, context, new QtPrivate::QFunctorSlotObject<Func1, 0, - typename QtPrivate::List_Left<void, 0>::Value, void>(slot)); + typename QtPrivate::List_Left<void, 0>::Value, void>(std::move(slot))); } #endif |