summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinQt/Debugger/MemoryViewWidget.cpp
diff options
context:
space:
mode:
authorAdmiral H. Curtiss <pikachu025@gmail.com>2022-04-24 06:49:10 +0200
committerAdmiral H. Curtiss <pikachu025@gmail.com>2022-04-24 16:22:36 +0200
commit787e3efeb850235b732c91930f54a3d96d6f74aa (patch)
tree6d989cf4eadcf195645c60529faabd77f20f9d4f /Source/Core/DolphinQt/Debugger/MemoryViewWidget.cpp
parent6920a24f1dc04ea0a651fe772614be22f8a2248f (diff)
Qt/MemoryViewWidget: Detect row breakpoint cell by cell data instead of cell position.
Diffstat (limited to 'Source/Core/DolphinQt/Debugger/MemoryViewWidget.cpp')
-rw-r--r--Source/Core/DolphinQt/Debugger/MemoryViewWidget.cpp26
1 files changed, 10 insertions, 16 deletions
diff --git a/Source/Core/DolphinQt/Debugger/MemoryViewWidget.cpp b/Source/Core/DolphinQt/Debugger/MemoryViewWidget.cpp
index fa92c4e886..cbd45c94a7 100644
--- a/Source/Core/DolphinQt/Debugger/MemoryViewWidget.cpp
+++ b/Source/Core/DolphinQt/Debugger/MemoryViewWidget.cpp
@@ -549,25 +549,19 @@ void MemoryViewWidget::wheelEvent(QWheelEvent* event)
void MemoryViewWidget::mousePressEvent(QMouseEvent* event)
{
- auto* item_selected = itemAt(event->pos());
- if (item_selected == nullptr)
+ if (event->button() != Qt::LeftButton)
return;
- const u32 address = item(row(item_selected), 1)->data(USER_ROLE_CELL_ADDRESS).toUInt();
-
- switch (event->button())
- {
- case Qt::LeftButton:
- if (column(item_selected) == 0)
- ToggleBreakpoint(address, true);
- else
- SetAddress(address);
+ auto* item = itemAt(event->pos());
+ if (!item)
+ return;
- Update();
- break;
- default:
- break;
- }
+ const u32 address = item->data(USER_ROLE_CELL_ADDRESS).toUInt();
+ if (item->data(USER_ROLE_IS_ROW_BREAKPOINT_CELL).toBool())
+ ToggleBreakpoint(address, true);
+ else
+ SetAddress(address);
+ Update();
}
void MemoryViewWidget::OnCopyAddress(u32 addr)