RunOnObject: accept pointers to member functions

This commit is contained in:
Michael M committed 2017-09-15 10:36:33 -07:00
1 parent 1e27e87d93
commit 7f812a7a03
2 files changed
+7 -1

No files matched your search

@@ -33,3 +33,9 @@ auto RunOnObject(QObject* object, F&& functor)
event.Wait();
return result;
}
template <typename Base, typename Type, typename Receiver>
auto RunOnObject(Receiver* obj, Type Base::*func)
{
return RunOnObject(obj, [obj, func] { return (obj->*func)(); });
}