diff options
author | Lioncash <mathew1800@gmail.com> | 2020-08-03 11:28:18 -0400 |
---|---|---|
committer | Lioncash <mathew1800@gmail.com> | 2020-08-03 11:54:04 -0400 |
commit | b249e4e0ce15c44bd0d917a17f79510af868173b (patch) | |
tree | d4dc63a692c446e87ee614481030af16385e88ba /src/yuzu/configuration/configure_mouse_advanced.cpp | |
parent | 9b75481755c8d566bc666465d659115bba2b2578 (diff) |
yuzu: Resolve C++20 deprecation warnings related to lambda captures
C++20 deprecates capturing the this pointer via the '=' capture.
Instead, we replace it or extend the capture specification.
Diffstat (limited to 'src/yuzu/configuration/configure_mouse_advanced.cpp')
-rw-r--r-- | src/yuzu/configuration/configure_mouse_advanced.cpp | 39 |
1 files changed, 21 insertions, 18 deletions
diff --git a/src/yuzu/configuration/configure_mouse_advanced.cpp b/src/yuzu/configuration/configure_mouse_advanced.cpp index e0647ea5bc..ea2549363a 100644 --- a/src/yuzu/configuration/configure_mouse_advanced.cpp +++ b/src/yuzu/configuration/configure_mouse_advanced.cpp @@ -83,25 +83,28 @@ ConfigureMouseAdvanced::ConfigureMouseAdvanced(QWidget* parent) } button->setContextMenuPolicy(Qt::CustomContextMenu); - connect(button, &QPushButton::clicked, [=] { - HandleClick( - button_map[button_id], - [=](const Common::ParamPackage& params) { buttons_param[button_id] = params; }, - InputCommon::Polling::DeviceType::Button); - }); - connect(button, &QPushButton::customContextMenuRequested, [=](const QPoint& menu_location) { - QMenu context_menu; - context_menu.addAction(tr("Clear"), [&] { - buttons_param[button_id].Clear(); - button_map[button_id]->setText(tr("[not set]")); - }); - context_menu.addAction(tr("Restore Default"), [&] { - buttons_param[button_id] = Common::ParamPackage{ - InputCommon::GenerateKeyboardParam(Config::default_mouse_buttons[button_id])}; - button_map[button_id]->setText(ButtonToText(buttons_param[button_id])); - }); - context_menu.exec(button_map[button_id]->mapToGlobal(menu_location)); + connect(button, &QPushButton::clicked, [=, this] { + HandleClick(button_map[button_id], + [=, this](const Common::ParamPackage& params) { + buttons_param[button_id] = params; + }, + InputCommon::Polling::DeviceType::Button); }); + connect(button, &QPushButton::customContextMenuRequested, + [=, this](const QPoint& menu_location) { + QMenu context_menu; + context_menu.addAction(tr("Clear"), [&] { + buttons_param[button_id].Clear(); + button_map[button_id]->setText(tr("[not set]")); + }); + context_menu.addAction(tr("Restore Default"), [&] { + buttons_param[button_id] = + Common::ParamPackage{InputCommon::GenerateKeyboardParam( + Config::default_mouse_buttons[button_id])}; + button_map[button_id]->setText(ButtonToText(buttons_param[button_id])); + }); + context_menu.exec(button_map[button_id]->mapToGlobal(menu_location)); + }); } connect(ui->buttonClearAll, &QPushButton::clicked, [this] { ClearAll(); }); |