mirror of https://github.com/PCSX2/pcsx2.git
Debugger: Make check box widgets in the symbol tree more responsive
This commit is contained in:
parent
d9c5f22d1e
commit
93b18412f5
|
@ -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<QCheckBox*>(sender());
|
||||
if (check_box)
|
||||
commitData(check_box);
|
||||
}
|
||||
|
||||
void SymbolTreeValueDelegate::onComboBoxIndexChanged(int index)
|
||||
{
|
||||
QComboBox* combo_box = qobject_cast<QComboBox*>(sender());
|
||||
|
|
|
@ -21,8 +21,10 @@ public:
|
|||
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;
|
||||
|
|
Loading…
Reference in New Issue