Fix repeated menu callback invocation.
This commit is contained in:
parent
4093d6605a
commit
3a6708cdc5
1 changed files with 2 additions and 2 deletions
|
|
@ -19,8 +19,8 @@ not_null<QAction*> CreateAction(
|
|||
Fn<void()> &&callback) {
|
||||
const auto action = new QAction(text, parent);
|
||||
const auto guard = MakeWeak(parent);
|
||||
auto triggered = [guard, callback = std::move(callback)]() mutable {
|
||||
InvokeQueued(guard, std::move(callback));
|
||||
auto triggered = [guard, callback = std::move(callback)] {
|
||||
InvokeQueued(guard, callback);
|
||||
};
|
||||
parent->connect(action, &QAction::triggered, std::move(triggered));
|
||||
return action;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue