Qt/MemoryViewWidget: Detect row breakpoint cell by cell data instead of cell position.
This commit is contained in:
parent
6920a24f1d
commit
787e3efeb8
|
@ -549,25 +549,19 @@ void MemoryViewWidget::wheelEvent(QWheelEvent* event)
|
||||||
|
|
||||||
void MemoryViewWidget::mousePressEvent(QMouseEvent* event)
|
void MemoryViewWidget::mousePressEvent(QMouseEvent* event)
|
||||||
{
|
{
|
||||||
auto* item_selected = itemAt(event->pos());
|
if (event->button() != Qt::LeftButton)
|
||||||
if (item_selected == nullptr)
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const u32 address = item(row(item_selected), 1)->data(USER_ROLE_CELL_ADDRESS).toUInt();
|
auto* item = itemAt(event->pos());
|
||||||
|
if (!item)
|
||||||
|
return;
|
||||||
|
|
||||||
switch (event->button())
|
const u32 address = item->data(USER_ROLE_CELL_ADDRESS).toUInt();
|
||||||
{
|
if (item->data(USER_ROLE_IS_ROW_BREAKPOINT_CELL).toBool())
|
||||||
case Qt::LeftButton:
|
ToggleBreakpoint(address, true);
|
||||||
if (column(item_selected) == 0)
|
else
|
||||||
ToggleBreakpoint(address, true);
|
SetAddress(address);
|
||||||
else
|
Update();
|
||||||
SetAddress(address);
|
|
||||||
|
|
||||||
Update();
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MemoryViewWidget::OnCopyAddress(u32 addr)
|
void MemoryViewWidget::OnCopyAddress(u32 addr)
|
||||||
|
|
Loading…
Reference in New Issue