diff --git a/pcsx2-qt/Debugger/SymbolTree/SymbolTreeDelegates.cpp b/pcsx2-qt/Debugger/SymbolTree/SymbolTreeDelegates.cpp index 3d199351be5ef..2922d08ef8834 100644 --- a/pcsx2-qt/Debugger/SymbolTree/SymbolTreeDelegates.cpp +++ b/pcsx2-qt/Debugger/SymbolTree/SymbolTreeDelegates.cpp @@ -77,6 +77,7 @@ QWidget* SymbolTreeValueDelegate::createEditor(QWidget* parent, const QStyleOpti { QCheckBox* editor = new QCheckBox(parent); editor->setChecked(value.toBool()); + connect(editor, &QCheckBox::checkStateChanged, this, &SymbolTreeValueDelegate::onCheckBoxStateChanged); result = editor; break; @@ -276,6 +277,13 @@ void SymbolTreeValueDelegate::setModelData(QWidget* editor, QAbstractItemModel* model->setData(index, value, SymbolTreeModel::EDIT_ROLE); } +void SymbolTreeValueDelegate::onCheckBoxStateChanged(Qt::CheckState state) +{ + QCheckBox* check_box = qobject_cast(sender()); + if (check_box) + commitData(check_box); +} + void SymbolTreeValueDelegate::onComboBoxIndexChanged(int index) { QComboBox* combo_box = qobject_cast(sender()); diff --git a/pcsx2-qt/Debugger/SymbolTree/SymbolTreeDelegates.h b/pcsx2-qt/Debugger/SymbolTree/SymbolTreeDelegates.h index 934727fe73146..03028297c5952 100644 --- a/pcsx2-qt/Debugger/SymbolTree/SymbolTreeDelegates.h +++ b/pcsx2-qt/Debugger/SymbolTree/SymbolTreeDelegates.h @@ -21,8 +21,10 @@ class SymbolTreeValueDelegate : public QStyledItemDelegate void setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const override; protected: - // Without this, setModelData would only be called when a combo box was - // deselected rather than when an option was picked. + // These make it so the values inputted are written back to memory + // immediately when the widgets are interacted with rather than when they + // are deselected. + void onCheckBoxStateChanged(Qt::CheckState state); void onComboBoxIndexChanged(int index); DebugInterface& m_cpu; diff --git a/pcsx2-qt/Debugger/SymbolTree/SymbolTreeModel.cpp b/pcsx2-qt/Debugger/SymbolTree/SymbolTreeModel.cpp index b7c10901cebea..b7cf365b46464 100644 --- a/pcsx2-qt/Debugger/SymbolTree/SymbolTreeModel.cpp +++ b/pcsx2-qt/Debugger/SymbolTree/SymbolTreeModel.cpp @@ -484,6 +484,9 @@ std::vector> SymbolTreeModel::populateChildren( } } + for (std::unique_ptr& child : children) + child->readFromVM(cpu, database); + return children; }