From c0028610411bab6d2a03f1786c598f1ba5fb065c Mon Sep 17 00:00:00 2001 From: Martino Fontana Date: Sun, 25 May 2025 19:11:36 +0200 Subject: [PATCH] CheatSearchWidget: "Add to watch" to all selected items Instead of just the right-clicked item. --- Source/Core/DolphinQt/CheatSearchWidget.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Source/Core/DolphinQt/CheatSearchWidget.cpp b/Source/Core/DolphinQt/CheatSearchWidget.cpp index 304e682674..f0f0346db8 100644 --- a/Source/Core/DolphinQt/CheatSearchWidget.cpp +++ b/Source/Core/DolphinQt/CheatSearchWidget.cpp @@ -498,9 +498,13 @@ void CheatSearchWidget::OnAddressTableContextMenu() menu->setAttribute(Qt::WA_DeleteOnClose, true); menu->addAction(tr("Show in memory"), [this, address] { emit ShowMemory(address); }); - menu->addAction(tr("Add to watch"), this, [this, address] { - const QString name = QStringLiteral("mem_%1").arg(address, 8, 16, QLatin1Char('0')); - emit RequestWatch(name, address); + menu->addAction(tr("Add to watch"), this, [this] { + for (auto* const item : m_address_table->selectedItems()) + { + const u32 address = item->data(ADDRESS_TABLE_ADDRESS_ROLE).toUInt(); + const QString name = QStringLiteral("mem_%1").arg(address, 8, 16, QLatin1Char('0')); + emit RequestWatch(name, address); + } }); menu->addAction(tr("Generate Action Replay Code(s)"), this, &CheatSearchWidget::GenerateARCodes);