diff options
| author | Admiral H. Curtiss <pikachu025@gmail.com> | 2022-04-26 02:43:01 +0200 |
|---|---|---|
| committer | Admiral H. Curtiss <pikachu025@gmail.com> | 2022-05-08 23:14:37 +0200 |
| commit | 7f94e62dd56a114f46be5dee4d4f7448de2f1873 (patch) | |
| tree | fa74f94ec95495eac78813ec7b4506a369a92c6b /Source/Core/DolphinQt/Debugger/MemoryViewWidget.cpp | |
| parent | 88dd9e57f3d438c61dbe95daf5a5e5436b0d3251 (diff) | |
Qt/MemoryViewWidget: Remove the behavior that clicking anywhere in the table centers the table on that row.
Diffstat (limited to 'Source/Core/DolphinQt/Debugger/MemoryViewWidget.cpp')
| -rw-r--r-- | Source/Core/DolphinQt/Debugger/MemoryViewWidget.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/Source/Core/DolphinQt/Debugger/MemoryViewWidget.cpp b/Source/Core/DolphinQt/Debugger/MemoryViewWidget.cpp index 9563338f57..c0733f4b86 100644 --- a/Source/Core/DolphinQt/Debugger/MemoryViewWidget.cpp +++ b/Source/Core/DolphinQt/Debugger/MemoryViewWidget.cpp @@ -51,6 +51,7 @@ public: setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); setShowGrid(false); setContextMenuPolicy(Qt::CustomContextMenu); + setSelectionMode(SingleSelection); connect(this, &MemoryViewTable::customContextMenuRequested, m_view, &MemoryViewWidget::OnContextMenu); @@ -105,12 +106,16 @@ public: if (!item) return; - const u32 address = item->data(USER_ROLE_CELL_ADDRESS).toUInt(); if (item->data(USER_ROLE_IS_ROW_BREAKPOINT_CELL).toBool()) + { + const u32 address = item->data(USER_ROLE_CELL_ADDRESS).toUInt(); m_view->ToggleBreakpoint(address, true); + m_view->Update(); + } else - m_view->SetAddress(address); - m_view->Update(); + { + QTableWidget::mousePressEvent(event); + } } private: @@ -284,7 +289,7 @@ void MemoryViewWidget::Update() for (int c = 2; c < m_table->columnCount(); c++) { auto* item = new QTableWidgetItem(QStringLiteral("-")); - item->setFlags(Qt::ItemIsEnabled); + item->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable); item->setData(USER_ROLE_IS_ROW_BREAKPOINT_CELL, false); item->setData(USER_ROLE_CELL_ADDRESS, row_address); item->setData(USER_ROLE_HAS_VALUE, false); @@ -378,7 +383,6 @@ void MemoryViewWidget::UpdateColumns(Type type, int first_column) } else { - cell_item->setFlags({}); cell_item->setText(QStringLiteral("-")); cell_item->setData(USER_ROLE_IS_ROW_BREAKPOINT_CELL, false); cell_item->setData(USER_ROLE_CELL_ADDRESS, cell_address); |
