From 9384f3a8e94b8481f775ce3289c1ce6d2843f04d Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Mon, 21 Dec 2020 01:33:40 +1000 Subject: [PATCH] Qt/CheatManager: Fix checking groups not updating child nodes --- src/duckstation-qt/cheatmanagerdialog.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/duckstation-qt/cheatmanagerdialog.cpp b/src/duckstation-qt/cheatmanagerdialog.cpp index b78ce52ac..736300f70 100644 --- a/src/duckstation-qt/cheatmanagerdialog.cpp +++ b/src/duckstation-qt/cheatmanagerdialog.cpp @@ -382,11 +382,20 @@ void CheatManagerDialog::cheatListItemChanged(QTreeWidgetItem* item, int column) if (!item || column != 0) return; + CheatList* list = getCheatList(); + const int index = getCheatIndexFromItem(item); if (index < 0) - return; + { + // we're probably a parent/group node + const int child_count = item->childCount(); + const Qt::CheckState cs = item->checkState(0); + for (int i = 0; i < child_count; i++) + item->child(i)->setCheckState(0, cs); + + return; + } - CheatList* list = getCheatList(); if (static_cast(index) >= list->GetCodeCount()) return;