From f4acff1321232e1f211a1d4674e72743eaff26b8 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Mon, 7 Mar 2022 20:09:37 +1000 Subject: [PATCH] Qt: Fix incorrect dropdown value in game properties --- pcsx2-qt/SettingWidgetBinder.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pcsx2-qt/SettingWidgetBinder.h b/pcsx2-qt/SettingWidgetBinder.h index 1c5160531c..ff89287db6 100644 --- a/pcsx2-qt/SettingWidgetBinder.h +++ b/pcsx2-qt/SettingWidgetBinder.h @@ -120,7 +120,7 @@ namespace SettingWidgetBinder } static std::optional getNullableIntValue(const QComboBox* widget) { - return isNullValue(widget) ? std::nullopt : std::optional(widget->currentIndex() + 1); + return isNullValue(widget) ? std::nullopt : std::optional(widget->currentIndex() - 1); } static void setNullableIntValue(QComboBox* widget, std::optional value) { @@ -439,9 +439,9 @@ namespace SettingWidgetBinder else Accessor::setNullableIntValue(widget, std::nullopt); - Accessor::connectValueChanged(widget, [sif, widget, section = std::move(section), key = std::move(key)]() { + Accessor::connectValueChanged(widget, [sif, widget, section = std::move(section), key = std::move(key), option_offset]() { if (std::optional new_value = Accessor::getNullableIntValue(widget); new_value.has_value()) - sif->SetIntValue(section.c_str(), key.c_str(), new_value.value()); + sif->SetIntValue(section.c_str(), key.c_str(), new_value.value() + option_offset); else sif->DeleteValue(section.c_str(), key.c_str());