Qt/CheatManager: Fix checking groups not updating child nodes

This commit is contained in:
Connor McLaughlin 2020-12-21 01:33:40 +10:00
parent 972872a0c8
commit 9384f3a8e9
1 changed files with 11 additions and 2 deletions

View File

@ -382,11 +382,20 @@ void CheatManagerDialog::cheatListItemChanged(QTreeWidgetItem* item, int column)
if (!item || column != 0) if (!item || column != 0)
return; return;
CheatList* list = getCheatList();
const int index = getCheatIndexFromItem(item); const int index = getCheatIndexFromItem(item);
if (index < 0) 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<u32>(index) >= list->GetCodeCount()) if (static_cast<u32>(index) >= list->GetCodeCount())
return; return;