Qt: Don't use bind with templated return type when void needed

This commit is contained in:
Vicki Pfau 2022-01-20 19:19:37 -08:00
parent a3ccb49e5d
commit d4f1838a4a
1 changed files with 3 additions and 1 deletions

View File

@ -73,7 +73,9 @@ private:
template<typename T, typename V> template<typename T, typename V>
Action* ActionMapper::addAction(const QString& visibleName, const QString& name, T* obj, V (T::*method)(), const QString& menu, const QKeySequence& shortcut) { Action* ActionMapper::addAction(const QString& visibleName, const QString& name, T* obj, V (T::*method)(), const QString& menu, const QKeySequence& shortcut) {
return addAction(visibleName, name, std::bind(method, obj), menu, shortcut); return addAction(visibleName, name, [method, obj]() -> void {
(obj->*method)();
}, menu, shortcut);
} }
template<typename T, typename V> template<typename T, typename V>