From f187483f528a41e75534dde45fc1b3a774a4eb14 Mon Sep 17 00:00:00 2001 From: cristian64 Date: Sun, 19 May 2024 18:26:03 +0100 Subject: [PATCH 01/10] Enable scroll-per-pixel in table-like widgets. Qt's default behavior (i.e. scroll per cell) is not user friendly when wide cells (e.g. **Scanned** and **Current** columns in the scanner pane) are present. --- Source/GUI/MemScanner/MemScanWidget.cpp | 2 ++ Source/GUI/MemWatcher/MemWatchWidget.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/Source/GUI/MemScanner/MemScanWidget.cpp b/Source/GUI/MemScanner/MemScanWidget.cpp index 5e6202a5..0fbbf1e9 100644 --- a/Source/GUI/MemScanner/MemScanWidget.cpp +++ b/Source/GUI/MemScanner/MemScanWidget.cpp @@ -38,6 +38,8 @@ void MemScanWidget::initialiseWidgets() m_tblResulstList->horizontalHeader()->resizeSection(ResultsListModel::RESULT_COL_ADDRESS, 125); m_tblResulstList->horizontalHeader()->resizeSection(ResultsListModel::RESULT_COL_SCANNED, 150); + m_tblResulstList->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel); + m_tblResulstList->setHorizontalScrollMode(QAbstractItemView::ScrollPerPixel); m_tblResulstList->setSelectionBehavior(QAbstractItemView::SelectRows); m_tblResulstList->setSelectionMode(QAbstractItemView::ExtendedSelection); m_tblResulstList->setMinimumWidth(385); diff --git a/Source/GUI/MemWatcher/MemWatchWidget.cpp b/Source/GUI/MemWatcher/MemWatchWidget.cpp index 93cbf337..31c95673 100644 --- a/Source/GUI/MemWatcher/MemWatchWidget.cpp +++ b/Source/GUI/MemWatcher/MemWatchWidget.cpp @@ -56,6 +56,8 @@ void MemWatchWidget::initialiseWidgets() m_watchView->setAcceptDrops(true); m_watchView->setDragDropMode(QAbstractItemView::InternalMove); m_watchView->setDropIndicatorShown(true); + m_watchView->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel); + m_watchView->setHorizontalScrollMode(QAbstractItemView::ScrollPerPixel); m_watchView->setSelectionBehavior(QAbstractItemView::SelectRows); m_watchView->setSelectionMode(QAbstractItemView::ExtendedSelection); m_watchView->setContextMenuPolicy(Qt::CustomContextMenu); From c7157959ee48b091183cf870a0ea25acca160de5 Mon Sep 17 00:00:00 2001 From: cristian64 Date: Sun, 19 May 2024 18:54:48 +0100 Subject: [PATCH 02/10] Define initial column width based on font metrics, and configure certain columns to fit to content. Columns whose content width is known in advance (addresses and watch types) are now configured to fit to content. --- Source/GUI/MemScanner/MemScanWidget.cpp | 10 ++++++++-- Source/GUI/MemWatcher/MemWatchWidget.cpp | 14 ++++++++++---- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/Source/GUI/MemScanner/MemScanWidget.cpp b/Source/GUI/MemScanner/MemScanWidget.cpp index 0fbbf1e9..9d931824 100644 --- a/Source/GUI/MemScanner/MemScanWidget.cpp +++ b/Source/GUI/MemScanner/MemScanWidget.cpp @@ -35,8 +35,14 @@ void MemScanWidget::initialiseWidgets() m_tblResulstList->setSelectionMode(QAbstractItemView::ExtendedSelection); m_tblResulstList->horizontalHeader()->setStretchLastSection(true); - m_tblResulstList->horizontalHeader()->resizeSection(ResultsListModel::RESULT_COL_ADDRESS, 125); - m_tblResulstList->horizontalHeader()->resizeSection(ResultsListModel::RESULT_COL_SCANNED, 150); + + const int charWidth{m_tblResulstList->fontMetrics().averageCharWidth()}; + m_tblResulstList->horizontalHeader()->setMinimumSectionSize(charWidth); + m_tblResulstList->horizontalHeader()->resizeSection(ResultsListModel::RESULT_COL_SCANNED, + charWidth * 15); + + m_tblResulstList->horizontalHeader()->setSectionResizeMode(ResultsListModel::RESULT_COL_ADDRESS, + QHeaderView::ResizeToContents); m_tblResulstList->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel); m_tblResulstList->setHorizontalScrollMode(QAbstractItemView::ScrollPerPixel); diff --git a/Source/GUI/MemWatcher/MemWatchWidget.cpp b/Source/GUI/MemWatcher/MemWatchWidget.cpp index 31c95673..478e0da0 100644 --- a/Source/GUI/MemWatcher/MemWatchWidget.cpp +++ b/Source/GUI/MemWatcher/MemWatchWidget.cpp @@ -68,10 +68,16 @@ void MemWatchWidget::initialiseWidgets() m_watchView->setItemDelegate(m_watchDelegate); m_watchView->setModel(m_watchModel); - m_watchView->header()->resizeSection(MemWatchModel::WATCH_COL_LOCK, 50); - m_watchView->header()->resizeSection(MemWatchModel::WATCH_COL_LABEL, 225); - m_watchView->header()->resizeSection(MemWatchModel::WATCH_COL_TYPE, 130); - m_watchView->header()->resizeSection(MemWatchModel::WATCH_COL_ADDRESS, 120); + const int charWidth{m_watchView->fontMetrics().averageCharWidth()}; + m_watchView->header()->setMinimumSectionSize(charWidth); + m_watchView->header()->resizeSection(MemWatchModel::WATCH_COL_LABEL, charWidth * 35); + + m_watchView->header()->setSectionResizeMode(MemWatchModel::WATCH_COL_TYPE, + QHeaderView::ResizeToContents); + m_watchView->header()->setSectionResizeMode(MemWatchModel::WATCH_COL_ADDRESS, + QHeaderView::ResizeToContents); + m_watchView->header()->setSectionResizeMode(MemWatchModel::WATCH_COL_LOCK, + QHeaderView::ResizeToContents); QShortcut* deleteWatchShortcut = new QShortcut(QKeySequence::Delete, m_watchView); connect(deleteWatchShortcut, &QShortcut::activated, this, &MemWatchWidget::onDeleteSelection); From 8b116e96c69f358e6876b120f0e6f4cadb5dcf55 Mon Sep 17 00:00:00 2001 From: cristian64 Date: Sun, 19 May 2024 20:05:26 +0100 Subject: [PATCH 03/10] Inherit window icon from main window into **Memory Viewer** dialog. --- Source/GUI/MainWindow.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/GUI/MainWindow.cpp b/Source/GUI/MainWindow.cpp index 15f58770..dfe9ed69 100644 --- a/Source/GUI/MainWindow.cpp +++ b/Source/GUI/MainWindow.cpp @@ -201,6 +201,7 @@ void MainWindow::makeLayouts() void MainWindow::makeMemViewer() { m_viewer = new MemViewerWidget(nullptr); + m_viewer->setWindowIcon(windowIcon()); connect(m_viewer, &MemViewerWidget::mustUnhook, this, &MainWindow::onUnhook); connect(m_viewer, &MemViewerWidget::addWatchRequested, m_watcher, &MemWatchWidget::addWatchEntry); connect(m_watcher, &MemWatchWidget::goToAddressInViewer, this, From 7f26c2ee18b3c8322a38415526d3121e6aa16edf Mon Sep 17 00:00:00 2001 From: cristian64 Date: Sun, 19 May 2024 20:24:46 +0100 Subject: [PATCH 04/10] Use fixed-width font for address and value columns. --- Source/GUI/MemScanner/MemScanWidget.cpp | 7 +++++++ Source/GUI/MemScanner/ResultsListModel.cpp | 8 ++++++++ Source/GUI/MemWatcher/Dialogs/DlgAddWatchEntry.cpp | 5 +++++ Source/GUI/MemWatcher/MemWatchDelegate.cpp | 4 ++++ Source/GUI/MemWatcher/MemWatchModel.cpp | 13 +++++++++++++ 5 files changed, 37 insertions(+) diff --git a/Source/GUI/MemScanner/MemScanWidget.cpp b/Source/GUI/MemScanner/MemScanWidget.cpp index 9d931824..d7101d4a 100644 --- a/Source/GUI/MemScanner/MemScanWidget.cpp +++ b/Source/GUI/MemScanner/MemScanWidget.cpp @@ -1,5 +1,6 @@ #include "MemScanWidget.h" +#include #include #include #include @@ -98,6 +99,12 @@ void MemScanWidget::initialiseWidgets() m_txbSearchRange2->setPlaceholderText("Search End (Optional)"); m_txbSearchRange2->setToolTip("Search Range End (Optional)"); + const QFont fixedFont{QFontDatabase::systemFont(QFontDatabase::SystemFont::FixedFont)}; + m_txbSearchTerm1->setFont(fixedFont); + m_txbSearchTerm2->setFont(fixedFont); + m_txbSearchRange1->setFont(fixedFont); + m_txbSearchRange2->setFont(fixedFont); + m_searchTerm2Widget = new QWidget(); m_searchTerm2Widget->hide(); diff --git a/Source/GUI/MemScanner/ResultsListModel.cpp b/Source/GUI/MemScanner/ResultsListModel.cpp index 7ff52b27..51ed87c7 100644 --- a/Source/GUI/MemScanner/ResultsListModel.cpp +++ b/Source/GUI/MemScanner/ResultsListModel.cpp @@ -1,5 +1,7 @@ #include "ResultsListModel.h" +#include + ResultsListModel::ResultsListModel(QObject* parent, MemScanner* scanner) : QAbstractTableModel(parent), m_scanner(scanner) { @@ -28,6 +30,12 @@ QVariant ResultsListModel::data(const QModelIndex& index, int role) const if (!index.isValid()) return {}; + if (role == Qt::FontRole) + { + static const QFont s_fixedFont{QFontDatabase::systemFont(QFontDatabase::SystemFont::FixedFont)}; + return s_fixedFont; + } + if (role == Qt::DisplayRole) { switch (index.column()) diff --git a/Source/GUI/MemWatcher/Dialogs/DlgAddWatchEntry.cpp b/Source/GUI/MemWatcher/Dialogs/DlgAddWatchEntry.cpp index d65643b6..e5cbfd6a 100644 --- a/Source/GUI/MemWatcher/Dialogs/DlgAddWatchEntry.cpp +++ b/Source/GUI/MemWatcher/Dialogs/DlgAddWatchEntry.cpp @@ -1,6 +1,7 @@ #include "DlgAddWatchEntry.h" #include +#include #include #include #include @@ -44,6 +45,10 @@ void DlgAddWatchEntry::initialiseWidgets() m_txbAddress->setMaxLength(10); connect(m_txbAddress, &QLineEdit::textEdited, this, &DlgAddWatchEntry::onAddressChanged); + const QFont fixedFont{QFontDatabase::systemFont(QFontDatabase::SystemFont::FixedFont)}; + m_txbAddress->setFont(fixedFont); + m_lblValuePreview->setFont(fixedFont); + m_offsetsLayout = new QGridLayout; m_offsets = QVector(); diff --git a/Source/GUI/MemWatcher/MemWatchDelegate.cpp b/Source/GUI/MemWatcher/MemWatchDelegate.cpp index 1f1b6860..2b9d231b 100644 --- a/Source/GUI/MemWatcher/MemWatchDelegate.cpp +++ b/Source/GUI/MemWatcher/MemWatchDelegate.cpp @@ -1,5 +1,6 @@ #include "MemWatchDelegate.h" +#include #include #include "../../MemoryWatch/MemWatchTreeNode.h" @@ -14,7 +15,10 @@ QWidget* MemWatchDelegate::createEditor(QWidget* parent, const QStyleOptionViewI MemWatchTreeNode* const node{MemWatchModel::getTreeNodeFromIndex(index)}; QLineEdit* editor = new QLineEdit(parent); if (index.column() == MemWatchModel::WATCH_COL_VALUE && !node->isGroup()) + { + editor->setFont(QFontDatabase::systemFont(QFontDatabase::SystemFont::FixedFont)); node->setValueEditing(true); + } GUICommon::g_valueEditing = true; return editor; } diff --git a/Source/GUI/MemWatcher/MemWatchModel.cpp b/Source/GUI/MemWatcher/MemWatchModel.cpp index ae54bf7d..ea8e8447 100644 --- a/Source/GUI/MemWatcher/MemWatchModel.cpp +++ b/Source/GUI/MemWatcher/MemWatchModel.cpp @@ -1,6 +1,7 @@ #include "MemWatchModel.h" #include +#include #include #include @@ -233,10 +234,22 @@ QVariant MemWatchModel::data(const QModelIndex& index, int role) const if (!index.isValid()) return {}; + const int column{index.column()}; + MemWatchTreeNode* item = static_cast(index.internalPointer()); if (!item->isGroup()) { + if (role == Qt::FontRole) + { + if (column == WATCH_COL_ADDRESS || column == WATCH_COL_VALUE) + { + static const QFont s_fixedFont{ + QFontDatabase::systemFont(QFontDatabase::SystemFont::FixedFont)}; + return s_fixedFont; + } + } + if (role == Qt::EditRole && index.column() == WATCH_COL_TYPE) return {static_cast(item->getEntry()->getType())}; From d520ef4159844745dc2fe603992211ff1c874682 Mon Sep 17 00:00:00 2001 From: cristian64 Date: Fri, 24 May 2024 21:05:24 +0100 Subject: [PATCH 05/10] Reformat an overlooked block with Clang-Format. --- Source/GUI/Settings/SConfig.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/GUI/Settings/SConfig.cpp b/Source/GUI/Settings/SConfig.cpp index 6378a30b..02fc9cab 100644 --- a/Source/GUI/Settings/SConfig.cpp +++ b/Source/GUI/Settings/SConfig.cpp @@ -3,10 +3,10 @@ #include #include -#include #include -#include #include +#include +#include namespace { From 0fbdc469dfad19bc9c4cc9a8da6622ff753bf078 Mon Sep 17 00:00:00 2001 From: cristian64 Date: Sun, 19 May 2024 20:45:23 +0100 Subject: [PATCH 06/10] Center check boxes in **Lock** column. The preexisting item delegate is used for painting and event handling. --- Source/GUI/MemWatcher/MemWatchDelegate.cpp | 66 ++++++++++++++++++++++ Source/GUI/MemWatcher/MemWatchDelegate.h | 4 ++ Source/GUI/MemWatcher/MemWatchModel.cpp | 14 +---- 3 files changed, 71 insertions(+), 13 deletions(-) diff --git a/Source/GUI/MemWatcher/MemWatchDelegate.cpp b/Source/GUI/MemWatcher/MemWatchDelegate.cpp index 2b9d231b..baf608a8 100644 --- a/Source/GUI/MemWatcher/MemWatchDelegate.cpp +++ b/Source/GUI/MemWatcher/MemWatchDelegate.cpp @@ -1,7 +1,9 @@ #include "MemWatchDelegate.h" +#include #include #include +#include #include "../../MemoryWatch/MemWatchTreeNode.h" #include "../GUICommon.h" @@ -39,3 +41,67 @@ void MemWatchDelegate::destroyEditor(QWidget* editor, const QModelIndex& index) GUICommon::g_valueEditing = false; editor->deleteLater(); } + +void MemWatchDelegate::paint(QPainter* const painter, const QStyleOptionViewItem& option_, + const QModelIndex& index) const +{ + QStyleOptionViewItem option = option_; + initStyleOption(&option, index); + + const int column{index.column()}; + if (column == MemWatchModel::WATCH_COL_LOCK) + { + MemWatchTreeNode* const node{MemWatchModel::getTreeNodeFromIndex(index)}; + MemWatchEntry* const entry{node->getEntry()}; + if (entry) + { + QStyleOptionButton checkboxstyle; + QRect checkbox_rect = + QApplication::style()->subElementRect(QStyle::SE_CheckBoxIndicator, &checkboxstyle); + checkboxstyle.rect = option.rect; + checkboxstyle.rect.setLeft(option.rect.x() + option.rect.width() / 2 - + checkbox_rect.width() / 2); + + const bool checked{entry->isLocked()}; + checkboxstyle.state = checked ? QStyle::State_On : QStyle::State_Off; + const bool enabled{static_cast(option.state & QStyle::State_Enabled)}; + if (enabled) + { + checkboxstyle.state |= QStyle::State_Enabled; + } + checkboxstyle.palette = option.palette; + + QStyledItemDelegate::paint(painter, option, index); + QApplication::style()->drawControl(QStyle::CE_CheckBox, &checkboxstyle, painter); + return; + } + } + + QStyledItemDelegate::paint(painter, option, index); +} + +bool MemWatchDelegate::editorEvent(QEvent* const event, QAbstractItemModel* const model, + const QStyleOptionViewItem& option, const QModelIndex& index) +{ + const QEvent::Type eventType{event->type()}; + + const int column{index.column()}; + if (column == MemWatchModel::WATCH_COL_LOCK) + { + if (eventType == QEvent::MouseButtonDblClick) + return true; // Consume event + + if (eventType == QEvent::MouseButtonRelease) + { + MemWatchTreeNode* const node{MemWatchModel::getTreeNodeFromIndex(index)}; + MemWatchEntry* const entry{node->getEntry()}; + if (entry) + { + entry->setLock(!entry->isLocked()); + return true; + } + } + } + + return QStyledItemDelegate::editorEvent(event, model, option, index); +} diff --git a/Source/GUI/MemWatcher/MemWatchDelegate.h b/Source/GUI/MemWatcher/MemWatchDelegate.h index f166934b..af02257e 100644 --- a/Source/GUI/MemWatcher/MemWatchDelegate.h +++ b/Source/GUI/MemWatcher/MemWatchDelegate.h @@ -10,4 +10,8 @@ class MemWatchDelegate : public QStyledItemDelegate void setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const override; void destroyEditor(QWidget* editor, const QModelIndex& index) const override; + void paint(QPainter* painter, const QStyleOptionViewItem& option, + const QModelIndex& index) const override; + bool editorEvent(QEvent* event, QAbstractItemModel* model, const QStyleOptionViewItem& option, + const QModelIndex& index) override; }; diff --git a/Source/GUI/MemWatcher/MemWatchModel.cpp b/Source/GUI/MemWatcher/MemWatchModel.cpp index ea8e8447..6e65f3fa 100644 --- a/Source/GUI/MemWatcher/MemWatchModel.cpp +++ b/Source/GUI/MemWatcher/MemWatchModel.cpp @@ -280,12 +280,6 @@ QVariant MemWatchModel::data(const QModelIndex& index, int role) const break; } } - else if (role == Qt::CheckStateRole && index.column() == WATCH_COL_LOCK) - { - if (entry->isLocked()) - return Qt::Checked; - return Qt::Unchecked; - } } else { @@ -349,12 +343,6 @@ bool MemWatchModel::editData(const QModelIndex& index, const QVariant& value, co } } } - else if (role == Qt::CheckStateRole && index.column() == WATCH_COL_LOCK) - { - value == Qt::Checked ? entry->setLock(true) : entry->setLock(false); - emit dataChanged(index, index); - return true; - } else { return false; @@ -388,7 +376,7 @@ Qt::ItemFlags MemWatchModel::flags(const QModelIndex& index) const } if (index.column() == WATCH_COL_LOCK) - return flags |= Qt::ItemIsUserCheckable; + return flags; if (index.column() != WATCH_COL_ADDRESS && index.column() != WATCH_COL_TYPE) flags |= Qt::ItemIsEditable; From 775bc3946c8a7c564e7641b82f6042c6ebe7dd05 Mon Sep 17 00:00:00 2001 From: cristian64 Date: Sun, 19 May 2024 20:48:50 +0100 Subject: [PATCH 07/10] Keep watcher widget enabled at all times. Previously, the widget would be set to a disabled state when DME was not hooked to Dolphin. --- Source/GUI/MainWindow.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Source/GUI/MainWindow.cpp b/Source/GUI/MainWindow.cpp index dfe9ed69..89f93c6b 100644 --- a/Source/GUI/MainWindow.cpp +++ b/Source/GUI/MainWindow.cpp @@ -283,7 +283,6 @@ void MainWindow::updateDolphinHookingStatus() tr("Hooked successfully to Dolphin, current start address: ") + QString::number(DolphinComm::DolphinAccessor::getEmuRAMAddressStart(), 16).toUpper()); m_scanner->setEnabled(true); - m_watcher->setEnabled(true); m_copier->setEnabled(true); m_actMemoryViewer->setEnabled(true); m_actCopyMemory->setEnabled(true); @@ -295,7 +294,6 @@ void MainWindow::updateDolphinHookingStatus() { m_lblDolphinStatus->setText(tr("Cannot hook to Dolphin, the process is not running")); m_scanner->setDisabled(true); - m_watcher->setDisabled(true); m_copier->setDisabled(true); m_actMemoryViewer->setDisabled(true); m_actCopyMemory->setDisabled(true); @@ -308,7 +306,6 @@ void MainWindow::updateDolphinHookingStatus() m_lblDolphinStatus->setText( tr("Cannot hook to Dolphin, the process is running, but no emulation has been started")); m_scanner->setDisabled(true); - m_watcher->setDisabled(true); m_copier->setDisabled(true); m_actMemoryViewer->setDisabled(true); m_actCopyMemory->setDisabled(true); @@ -320,7 +317,6 @@ void MainWindow::updateDolphinHookingStatus() { m_lblDolphinStatus->setText(tr("Unhooked, press \"Hook\" to hook to Dolphin again")); m_scanner->setDisabled(true); - m_watcher->setDisabled(true); m_copier->setDisabled(true); m_actMemoryViewer->setDisabled(true); m_actCopyMemory->setDisabled(true); From c85fe22d45f1c56adc95ab41714b2cfcba970d5b Mon Sep 17 00:00:00 2001 From: cristian64 Date: Sun, 19 May 2024 21:02:21 +0100 Subject: [PATCH 08/10] Disallow value editing if not hooked to Dolphin. --- Source/GUI/MemWatcher/MemWatchModel.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Source/GUI/MemWatcher/MemWatchModel.cpp b/Source/GUI/MemWatcher/MemWatchModel.cpp index 6e65f3fa..eb44cd4f 100644 --- a/Source/GUI/MemWatcher/MemWatchModel.cpp +++ b/Source/GUI/MemWatcher/MemWatchModel.cpp @@ -12,6 +12,7 @@ #include "../../CheatEngineParser/CheatEngineParser.h" #include "../../Common/CommonUtils.h" +#include "../../DolphinProcess/DolphinAccessor.h" #include "../GUICommon.h" namespace @@ -378,8 +379,18 @@ Qt::ItemFlags MemWatchModel::flags(const QModelIndex& index) const if (index.column() == WATCH_COL_LOCK) return flags; - if (index.column() != WATCH_COL_ADDRESS && index.column() != WATCH_COL_TYPE) + if (index.column() == WATCH_COL_LABEL) + { flags |= Qt::ItemIsEditable; + } + else if (index.column() == WATCH_COL_VALUE) + { + const bool hooked{DolphinComm::DolphinAccessor::getStatus() == + DolphinComm::DolphinAccessor::DolphinStatus::hooked}; + const Qt::ItemFlag itemIsEditable{hooked ? Qt::ItemIsEditable : Qt::NoItemFlags}; + flags |= itemIsEditable; + } + return flags; } From 17285a29c60c5edfe88c4db83faf74577f4e58d9 Mon Sep 17 00:00:00 2001 From: cristian64 Date: Fri, 24 May 2024 08:19:23 +0100 Subject: [PATCH 09/10] Drop label for the scan base group box. The label is only occupying vertical space; the set of options is self-explanatory. --- Source/GUI/MemScanner/MemScanWidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/GUI/MemScanner/MemScanWidget.cpp b/Source/GUI/MemScanner/MemScanWidget.cpp index d7101d4a..6b4f560a 100644 --- a/Source/GUI/MemScanner/MemScanWidget.cpp +++ b/Source/GUI/MemScanner/MemScanWidget.cpp @@ -133,7 +133,7 @@ void MemScanWidget::initialiseWidgets() m_btnGroupScanBase->addButton(m_rdbBaseBinary, 3); m_rdbBaseDecimal->setChecked(true); - m_groupScanBase = new QGroupBox(tr("Base to use")); + m_groupScanBase = new QGroupBox({}); m_chkSignedScan = new QCheckBox(tr("Signed value scan")); m_chkSignedScan->setChecked(false); From 8b6b31a3bed8f7f0dd72d5007abec1be83b27f29 Mon Sep 17 00:00:00 2001 From: cristian64 Date: Fri, 24 May 2024 20:39:35 +0100 Subject: [PATCH 10/10] Select entire row when auto-selecting newly inserted rows. Row auto-selection was introduced in 43ec8492de, but it was overlooked that only one cell in each row was being selected. --- Source/GUI/MemWatcher/MemWatchWidget.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/GUI/MemWatcher/MemWatchWidget.cpp b/Source/GUI/MemWatcher/MemWatchWidget.cpp index 478e0da0..08a29977 100644 --- a/Source/GUI/MemWatcher/MemWatchWidget.cpp +++ b/Source/GUI/MemWatcher/MemWatchWidget.cpp @@ -618,7 +618,8 @@ void MemWatchWidget::onRowsInserted(const QModelIndex& parent, const int first, { const QModelIndex firstIndex{m_watchModel->index(first, 0, parent)}; const QModelIndex lastIndex{m_watchModel->index(last, 0, parent)}; - const QItemSelection selection{firstIndex, lastIndex}; + const QItemSelection selection{firstIndex, + lastIndex.siblingAtColumn(MemWatchModel::WATCH_COL_NUM - 1)}; QItemSelectionModel* const selectionModel{m_watchView->selectionModel()}; selectionModel->select(selection, QItemSelectionModel::ClearAndSelect);