From ff0b748d58c6d2d0252740d2074609fd4e57454a Mon Sep 17 00:00:00 2001 From: Stenzek Date: Fri, 12 Apr 2024 22:22:58 +1000 Subject: [PATCH] Qt: Change stateChanged() to checkStateChanged() Introduced in Qt 6.7. --- pcsx2-qt/SettingWidgetBinder.h | 2 +- .../Settings/AchievementSettingsWidget.cpp | 10 +++--- pcsx2-qt/Settings/AudioSettingsWidget.cpp | 4 +-- pcsx2-qt/Settings/BIOSSettingsWidget.cpp | 2 +- .../ControllerGlobalSettingsWidget.cpp | 6 ++-- pcsx2-qt/Settings/DEV9SettingsWidget.cpp | 36 +++++++++---------- pcsx2-qt/Settings/DEV9SettingsWidget.h | 10 +++--- pcsx2-qt/Settings/DebugSettingsWidget.cpp | 2 +- pcsx2-qt/Settings/EmulationSettingsWidget.cpp | 2 +- pcsx2-qt/Settings/GameCheatSettingsWidget.cpp | 4 +-- pcsx2-qt/Settings/GameListSettingsWidget.cpp | 4 +-- pcsx2-qt/Settings/GamePatchSettingsWidget.cpp | 4 +-- pcsx2-qt/Settings/GraphicsSettingsWidget.cpp | 17 +++++---- pcsx2-qt/Settings/InterfaceSettingsWidget.cpp | 2 +- .../Settings/MemoryCardSettingsWidget.cpp | 2 +- pcsx2-qt/SetupWizardDialog.cpp | 2 +- 16 files changed, 54 insertions(+), 55 deletions(-) diff --git a/pcsx2-qt/SettingWidgetBinder.h b/pcsx2-qt/SettingWidgetBinder.h index 9db386dd42..92f7fcfb7a 100644 --- a/pcsx2-qt/SettingWidgetBinder.h +++ b/pcsx2-qt/SettingWidgetBinder.h @@ -252,7 +252,7 @@ namespace SettingWidgetBinder template static void connectValueChanged(QCheckBox* widget, F func) { - widget->connect(widget, &QCheckBox::stateChanged, func); + widget->connect(widget, &QCheckBox::checkStateChanged, func); } }; diff --git a/pcsx2-qt/Settings/AchievementSettingsWidget.cpp b/pcsx2-qt/Settings/AchievementSettingsWidget.cpp index ef9288ae86..1648011cfd 100644 --- a/pcsx2-qt/Settings/AchievementSettingsWidget.cpp +++ b/pcsx2-qt/Settings/AchievementSettingsWidget.cpp @@ -46,11 +46,11 @@ AchievementSettingsWidget::AchievementSettingsWidget(SettingsWindow* dialog, QWi dialog->registerWidgetHelp(m_ui.spectatorMode, tr("Enable Spectator Mode"), tr("Unchecked"), tr("When enabled, PCSX2 will assume all achievements are locked and not send any unlock notifications to the server.")); dialog->registerWidgetHelp(m_ui.unofficialAchievements, tr("Test Unofficial Achievements"), tr("Unchecked"), tr("When enabled, PCSX2 will list achievements from unofficial sets. Please note that these achievements are not tracked by RetroAchievements, so they unlock every time.")); - connect(m_ui.enable, &QCheckBox::stateChanged, this, &AchievementSettingsWidget::updateEnableState); - connect(m_ui.hardcoreMode, &QCheckBox::stateChanged, this, &AchievementSettingsWidget::updateEnableState); - connect(m_ui.hardcoreMode, &QCheckBox::stateChanged, this, &AchievementSettingsWidget::onHardcoreModeStateChanged); - connect(m_ui.achievementNotifications, &QCheckBox::stateChanged, this, &AchievementSettingsWidget::updateEnableState); - connect(m_ui.leaderboardNotifications, &QCheckBox::stateChanged, this, &AchievementSettingsWidget::updateEnableState); + connect(m_ui.enable, &QCheckBox::checkStateChanged, this, &AchievementSettingsWidget::updateEnableState); + connect(m_ui.hardcoreMode, &QCheckBox::checkStateChanged, this, &AchievementSettingsWidget::updateEnableState); + connect(m_ui.hardcoreMode, &QCheckBox::checkStateChanged, this, &AchievementSettingsWidget::onHardcoreModeStateChanged); + connect(m_ui.achievementNotifications, &QCheckBox::checkStateChanged, this, &AchievementSettingsWidget::updateEnableState); + connect(m_ui.leaderboardNotifications, &QCheckBox::checkStateChanged, this, &AchievementSettingsWidget::updateEnableState); connect(m_ui.achievementNotificationsDuration, &QSlider::valueChanged, this, &AchievementSettingsWidget::onAchievementsNotificationDurationSliderChanged); connect(m_ui.leaderboardNotificationsDuration, &QSlider::valueChanged, this, &AchievementSettingsWidget::onLeaderboardsNotificationDurationSliderChanged); diff --git a/pcsx2-qt/Settings/AudioSettingsWidget.cpp b/pcsx2-qt/Settings/AudioSettingsWidget.cpp index 603a853237..1f028bab36 100644 --- a/pcsx2-qt/Settings/AudioSettingsWidget.cpp +++ b/pcsx2-qt/Settings/AudioSettingsWidget.cpp @@ -53,8 +53,8 @@ AudioSettingsWidget::AudioSettingsWidget(SettingsWindow* dialog, QWidget* parent connect(m_ui.backend, &QComboBox::currentIndexChanged, this, &AudioSettingsWidget::outputBackendChanged); connect(m_ui.targetLatency, &QSlider::valueChanged, this, &AudioSettingsWidget::updateLatencyLabels); connect(m_ui.outputLatency, &QSlider::valueChanged, this, &AudioSettingsWidget::updateLatencyLabels); - connect(m_ui.outputLatencyMinimal, &QCheckBox::stateChanged, this, &AudioSettingsWidget::updateLatencyLabels); - connect(m_ui.outputLatencyMinimal, &QCheckBox::stateChanged, this, &AudioSettingsWidget::onMinimalOutputLatencyStateChanged); + connect(m_ui.outputLatencyMinimal, &QCheckBox::checkStateChanged, this, &AudioSettingsWidget::updateLatencyLabels); + connect(m_ui.outputLatencyMinimal, &QCheckBox::checkStateChanged, this, &AudioSettingsWidget::onMinimalOutputLatencyStateChanged); outputModuleChanged(); m_ui.volume->setValue(m_dialog->getEffectiveIntValue("SPU2/Mixing", "FinalVolume", DEFAULT_VOLUME)); diff --git a/pcsx2-qt/Settings/BIOSSettingsWidget.cpp b/pcsx2-qt/Settings/BIOSSettingsWidget.cpp index c7634619e3..4e36e395f2 100644 --- a/pcsx2-qt/Settings/BIOSSettingsWidget.cpp +++ b/pcsx2-qt/Settings/BIOSSettingsWidget.cpp @@ -40,7 +40,7 @@ BIOSSettingsWidget::BIOSSettingsWidget(SettingsWindow* dialog, QWidget* parent) connect(m_ui.searchDirectory, &QLineEdit::textChanged, this, &BIOSSettingsWidget::refreshList); connect(m_ui.refresh, &QPushButton::clicked, this, &BIOSSettingsWidget::refreshList); connect(m_ui.fileList, &QTreeWidget::currentItemChanged, this, &BIOSSettingsWidget::listItemChanged); - connect(m_ui.fastBoot, &QCheckBox::stateChanged, this, &BIOSSettingsWidget::fastBootChanged); + connect(m_ui.fastBoot, &QCheckBox::checkStateChanged, this, &BIOSSettingsWidget::fastBootChanged); } BIOSSettingsWidget::~BIOSSettingsWidget() = default; diff --git a/pcsx2-qt/Settings/ControllerGlobalSettingsWidget.cpp b/pcsx2-qt/Settings/ControllerGlobalSettingsWidget.cpp index d5a0051dd5..2dbc357d96 100644 --- a/pcsx2-qt/Settings/ControllerGlobalSettingsWidget.cpp +++ b/pcsx2-qt/Settings/ControllerGlobalSettingsWidget.cpp @@ -20,7 +20,7 @@ ControllerGlobalSettingsWidget::ControllerGlobalSettingsWidget(QWidget* parent, SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.enableSDLSource, "InputSources", "SDL", true); SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.enableSDLEnhancedMode, "InputSources", "SDLControllerEnhancedMode", false); - connect(m_ui.enableSDLSource, &QCheckBox::stateChanged, this, &ControllerGlobalSettingsWidget::updateSDLOptionsEnabled); + connect(m_ui.enableSDLSource, &QCheckBox::checkStateChanged, this, &ControllerGlobalSettingsWidget::updateSDLOptionsEnabled); connect(m_ui.ledSettings, &QToolButton::clicked, this, &ControllerGlobalSettingsWidget::ledSettingsClicked); #ifdef _WIN32 @@ -64,7 +64,7 @@ ControllerGlobalSettingsWidget::ControllerGlobalSettingsWidget(QWidget* parent, if (dialog->isEditingProfile()) { m_ui.useProfileHotkeyBindings->setChecked(m_dialog->getBoolValue("Pad", "UseProfileHotkeyBindings", false)); - connect(m_ui.useProfileHotkeyBindings, &QCheckBox::stateChanged, this, [this](int new_state) { + connect(m_ui.useProfileHotkeyBindings, &QCheckBox::checkStateChanged, this, [this](int new_state) { m_dialog->setBoolValue("Pad", "UseProfileHotkeyBindings", (new_state == Qt::Checked)); emit bindingSetupChanged(); }); @@ -78,7 +78,7 @@ ControllerGlobalSettingsWidget::ControllerGlobalSettingsWidget(QWidget* parent, } for (QCheckBox* cb : {m_ui.multitapPort1, m_ui.multitapPort2}) - connect(cb, &QCheckBox::stateChanged, this, [this]() { emit bindingSetupChanged(); }); + connect(cb, &QCheckBox::checkStateChanged, this, [this]() { emit bindingSetupChanged(); }); updateSDLOptionsEnabled(); } diff --git a/pcsx2-qt/Settings/DEV9SettingsWidget.cpp b/pcsx2-qt/Settings/DEV9SettingsWidget.cpp index 706ae0691e..ac54c1cd45 100644 --- a/pcsx2-qt/Settings/DEV9SettingsWidget.cpp +++ b/pcsx2-qt/Settings/DEV9SettingsWidget.cpp @@ -59,7 +59,7 @@ DEV9SettingsWidget::DEV9SettingsWidget(SettingsWindow* dialog, QWidget* parent) //but we then need to manually call onEthAutoChanged to update the UI on fist load SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.ethEnabled, "DEV9/Eth", "EthEnable", false); onEthEnabledChanged(m_ui.ethEnabled->checkState()); - connect(m_ui.ethEnabled, QOverload::of(&QCheckBox::stateChanged), this, &DEV9SettingsWidget::onEthEnabledChanged); + connect(m_ui.ethEnabled, &QCheckBox::checkStateChanged, this, &DEV9SettingsWidget::onEthEnabledChanged); ////////////////////////////////////////////////////////////////////////// // Eth Device Settings @@ -146,7 +146,7 @@ DEV9SettingsWidget::DEV9SettingsWidget(SettingsWindow* dialog, QWidget* parent) ////////////////////////////////////////////////////////////////////////// SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.ethInterceptDHCP, "DEV9/Eth", "InterceptDHCP", false); onEthDHCPInterceptChanged(m_ui.ethInterceptDHCP->checkState()); - connect(m_ui.ethInterceptDHCP, QOverload::of(&QCheckBox::stateChanged), this, &DEV9SettingsWidget::onEthDHCPInterceptChanged); + connect(m_ui.ethInterceptDHCP, &QCheckBox::checkStateChanged, this, &DEV9SettingsWidget::onEthDHCPInterceptChanged); //IP settings const IPValidator* ipValidator = new IPValidator(this, m_dialog->isPerGameSettings()); @@ -191,11 +191,11 @@ DEV9SettingsWidget::DEV9SettingsWidget(SettingsWindow* dialog, QWidget* parent) //Auto SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.ethNetMaskAuto, "DEV9/Eth", "AutoMask", true); onEthAutoChanged(m_ui.ethNetMaskAuto, m_ui.ethNetMaskAuto->checkState(), m_ui.ethNetMask, "DEV9/Eth", "AutoMask"); - connect(m_ui.ethNetMaskAuto, QOverload::of(&QCheckBox::stateChanged), this, [&](int state) { onEthAutoChanged(m_ui.ethNetMaskAuto, state, m_ui.ethNetMask, "DEV9/Eth", "AutoMask"); }); + connect(m_ui.ethNetMaskAuto, &QCheckBox::checkStateChanged, this, [&](Qt::CheckState state) { onEthAutoChanged(m_ui.ethNetMaskAuto, state, m_ui.ethNetMask, "DEV9/Eth", "AutoMask"); }); SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.ethGatewayAuto, "DEV9/Eth", "AutoGateway", true); onEthAutoChanged(m_ui.ethGatewayAuto, m_ui.ethGatewayAuto->checkState(), m_ui.ethGatewayAddr, "DEV9/Eth", "AutoGateway"); - connect(m_ui.ethGatewayAuto, QOverload::of(&QCheckBox::stateChanged), this, [&](int state) { onEthAutoChanged(m_ui.ethGatewayAuto, state, m_ui.ethGatewayAddr, "DEV9/Eth", "AutoGateway"); }); + connect(m_ui.ethGatewayAuto, &QCheckBox::checkStateChanged, this, [&](Qt::CheckState state) { onEthAutoChanged(m_ui.ethGatewayAuto, state, m_ui.ethGatewayAddr, "DEV9/Eth", "AutoGateway"); }); SettingWidgetBinder::BindWidgetToEnumSetting(sif, m_ui.ethDNS1Mode, "DEV9/Eth", "ModeDNS1", s_dns_name, Pcsx2Config::DEV9Options::DnsModeNames, Pcsx2Config::DEV9Options::DnsModeNames[static_cast(Pcsx2Config::DEV9Options::DnsMode::Auto)], "DEV9SettingsWidget"); @@ -242,7 +242,7 @@ DEV9SettingsWidget::DEV9SettingsWidget(SettingsWindow* dialog, QWidget* parent) ////////////////////////////////////////////////////////////////////////// // HDD Settings ////////////////////////////////////////////////////////////////////////// - connect(m_ui.hddEnabled, QOverload::of(&QCheckBox::stateChanged), this, &DEV9SettingsWidget::onHddEnabledChanged); + connect(m_ui.hddEnabled, &QCheckBox::checkStateChanged, this, &DEV9SettingsWidget::onHddEnabledChanged); SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.hddEnabled, "DEV9/Hdd", "HddEnable", false); if (m_dialog->isPerGameSettings()) @@ -253,7 +253,7 @@ DEV9SettingsWidget::DEV9SettingsWidget(SettingsWindow* dialog, QWidget* parent) else m_ui.hddFile->setText(QString::fromUtf8(m_dialog->getStringValue("DEV9/Hdd", "HddFile", "DEV9hdd.raw").value().c_str())); - connect(m_ui.hddLBA48, QOverload::of(&QCheckBox::stateChanged), this, &DEV9SettingsWidget::onHddLBA48Changed); + connect(m_ui.hddLBA48, &QCheckBox::checkStateChanged, this, &DEV9SettingsWidget::onHddLBA48Changed); UpdateHddSizeUIValues(); @@ -267,7 +267,7 @@ DEV9SettingsWidget::DEV9SettingsWidget(SettingsWindow* dialog, QWidget* parent) connect(m_ui.hddCreate, &QPushButton::clicked, this, &DEV9SettingsWidget::onHddCreateClicked); } -void DEV9SettingsWidget::onEthEnabledChanged(int state) +void DEV9SettingsWidget::onEthEnabledChanged(Qt::CheckState state) { const bool enabled = state == Qt::CheckState::PartiallyChecked ? Host::GetBaseBoolSettingValue("DEV9/Eth", "EthEnable", false) : state; @@ -356,7 +356,7 @@ void DEV9SettingsWidget::onEthDeviceChanged(int index) } } -void DEV9SettingsWidget::onEthDHCPInterceptChanged(int state) +void DEV9SettingsWidget::onEthDHCPInterceptChanged(Qt::CheckState state) { const bool enabled = (state == Qt::CheckState::PartiallyChecked ? Host::GetBaseBoolSettingValue("DEV9/Eth", "InterceptDHCP", false) : state) || ((m_adapter_options & AdapterOptions::DHCP_ForcedOn) == AdapterOptions::DHCP_ForcedOn); @@ -411,7 +411,7 @@ void DEV9SettingsWidget::onEthIPChanged(QLineEdit* sender, const char* section, m_dialog->setStringSettingValue(section, key, neatStr.c_str()); } -void DEV9SettingsWidget::onEthAutoChanged(QCheckBox* sender, int state, QLineEdit* input, const char* section, const char* key) +void DEV9SettingsWidget::onEthAutoChanged(QCheckBox* sender, Qt::CheckState state, QLineEdit* input, const char* section, const char* key) { if (sender->isEnabled()) { @@ -661,7 +661,7 @@ void DEV9SettingsWidget::onEthHostEdit(QStandardItem* item) } } -void DEV9SettingsWidget::onHddEnabledChanged(int state) +void DEV9SettingsWidget::onHddEnabledChanged(Qt::CheckState state) { const bool enabled = state == Qt::CheckState::PartiallyChecked ? Host::GetBaseBoolSettingValue("DEV9/Hdd", "HddEnable", false) : state; @@ -722,17 +722,17 @@ void DEV9SettingsWidget::onHddSizeAccessorSpin() m_ui.hddSizeSlider->setValue(m_ui.hddSizeSpinBox->value()); } -void DEV9SettingsWidget::onHddLBA48Changed(int state) +void DEV9SettingsWidget::onHddLBA48Changed(Qt::CheckState state) { - m_ui.hddSizeSlider->setMaximum(state ? 2000 : 120); - m_ui.hddSizeSpinBox->setMaximum(state ? 2000 : 120); - m_ui.hddSizeMaxLabel->setText(state ? tr("2000") : tr("120")); + m_ui.hddSizeSlider->setMaximum((state != Qt::Unchecked) ? 2000 : 120); + m_ui.hddSizeSpinBox->setMaximum((state != Qt::Unchecked) ? 2000 : 120); + m_ui.hddSizeMaxLabel->setText((state != Qt::Unchecked) ? tr("2000") : tr("120")); // Bump up min size to have ticks align with 100GiB sizes - m_ui.hddSizeSlider->setMinimum(state ? 100 : 40); - m_ui.hddSizeSpinBox->setMinimum(state ? 100 : 40); - m_ui.hddSizeMinLabel->setText(state ? tr("100") : tr("40")); + m_ui.hddSizeSlider->setMinimum((state != Qt::Unchecked) ? 100 : 40); + m_ui.hddSizeSpinBox->setMinimum((state != Qt::Unchecked) ? 100 : 40); + m_ui.hddSizeMinLabel->setText((state != Qt::Unchecked) ? tr("100") : tr("40")); - m_ui.hddSizeSlider->setTickInterval(state ? 100 : 5); + m_ui.hddSizeSlider->setTickInterval((state != Qt::Unchecked) ? 100 : 5); } void DEV9SettingsWidget::onHddCreateClicked() diff --git a/pcsx2-qt/Settings/DEV9SettingsWidget.h b/pcsx2-qt/Settings/DEV9SettingsWidget.h index 860a2d159b..e29e007027 100644 --- a/pcsx2-qt/Settings/DEV9SettingsWidget.h +++ b/pcsx2-qt/Settings/DEV9SettingsWidget.h @@ -19,12 +19,12 @@ class DEV9SettingsWidget : public QWidget Q_OBJECT private Q_SLOTS: - void onEthEnabledChanged(int state); + void onEthEnabledChanged(Qt::CheckState state); void onEthDeviceTypeChanged(int index); void onEthDeviceChanged(int index); - void onEthDHCPInterceptChanged(int state); + void onEthDHCPInterceptChanged(Qt::CheckState state); void onEthIPChanged(QLineEdit* sender, const char* section, const char* key); - void onEthAutoChanged(QCheckBox* sender, int state, QLineEdit* input, const char* section, const char* key); + void onEthAutoChanged(QCheckBox* sender, Qt::CheckState state, QLineEdit* input, const char* section, const char* key); void onEthDNSModeChanged(QComboBox* sender, int index, QLineEdit* input, const char* section, const char* key); void onEthHostAdd(); void onEthHostDel(); @@ -33,13 +33,13 @@ private Q_SLOTS: void onEthHostPerGame(); void onEthHostEdit(QStandardItem* item); - void onHddEnabledChanged(int state); + void onHddEnabledChanged(Qt::CheckState state); void onHddBrowseFileClicked(); void onHddFileTextChange(); void onHddFileEdit(); void onHddSizeSlide(int i); void onHddSizeAccessorSpin(); - void onHddLBA48Changed(int state); + void onHddLBA48Changed(Qt::CheckState state); void onHddCreateClicked(); public: diff --git a/pcsx2-qt/Settings/DebugSettingsWidget.cpp b/pcsx2-qt/Settings/DebugSettingsWidget.cpp index fc55c713a9..8f184aa3f1 100644 --- a/pcsx2-qt/Settings/DebugSettingsWidget.cpp +++ b/pcsx2-qt/Settings/DebugSettingsWidget.cpp @@ -33,7 +33,7 @@ DebugSettingsWidget::DebugSettingsWidget(SettingsWindow* dialog, QWidget* parent SettingWidgetBinder::BindWidgetToFolderSetting( sif, m_ui.swDumpDirectory, m_ui.swDumpBrowse, m_ui.swDumpOpen, nullptr, "EmuCore/GS", "SWDumpDirectory", std::string(), false); - connect(m_ui.dumpGSDraws, &QCheckBox::stateChanged, this, &DebugSettingsWidget::onDrawDumpingChanged); + connect(m_ui.dumpGSDraws, &QCheckBox::checkStateChanged, this, &DebugSettingsWidget::onDrawDumpingChanged); onDrawDumpingChanged(); } diff --git a/pcsx2-qt/Settings/EmulationSettingsWidget.cpp b/pcsx2-qt/Settings/EmulationSettingsWidget.cpp index e5a8fea6c5..f608f6347c 100644 --- a/pcsx2-qt/Settings/EmulationSettingsWidget.cpp +++ b/pcsx2-qt/Settings/EmulationSettingsWidget.cpp @@ -32,7 +32,7 @@ EmulationSettingsWidget::EmulationSettingsWidget(SettingsWindow* dialog, QWidget SettingWidgetBinder::BindWidgetToIntSetting(sif, m_ui.maxFrameLatency, "EmuCore/GS", "VsyncQueueSize", DEFAULT_FRAME_LATENCY); SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.syncToHostRefreshRate, "EmuCore/GS", "SyncToHostRefreshRate", false); - connect(m_ui.optimalFramePacing, &QCheckBox::stateChanged, this, &EmulationSettingsWidget::onOptimalFramePacingChanged); + connect(m_ui.optimalFramePacing, &QCheckBox::checkStateChanged, this, &EmulationSettingsWidget::onOptimalFramePacingChanged); m_ui.optimalFramePacing->setTristate(dialog->isPerGameSettings()); SettingWidgetBinder::BindWidgetToIntSetting(sif, m_ui.eeCycleSkipping, "EmuCore/Speedhacks", "EECycleSkip", DEFAULT_EE_CYCLE_SKIP); diff --git a/pcsx2-qt/Settings/GameCheatSettingsWidget.cpp b/pcsx2-qt/Settings/GameCheatSettingsWidget.cpp index 13c6f558c1..0c19628754 100644 --- a/pcsx2-qt/Settings/GameCheatSettingsWidget.cpp +++ b/pcsx2-qt/Settings/GameCheatSettingsWidget.cpp @@ -25,13 +25,13 @@ GameCheatSettingsWidget::GameCheatSettingsWidget(SettingsWindow* dialog, QWidget SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.allCRCsCheckbox, "EmuCore", "ShowCheatsForAllCRCs", false); updateListEnabled(); - connect(m_ui.enableCheats, &QCheckBox::stateChanged, this, &GameCheatSettingsWidget::updateListEnabled); + connect(m_ui.enableCheats, &QCheckBox::checkStateChanged, this, &GameCheatSettingsWidget::updateListEnabled); connect(m_ui.cheatList, &QTreeWidget::itemDoubleClicked, this, &GameCheatSettingsWidget::onCheatListItemDoubleClicked); connect(m_ui.cheatList, &QTreeWidget::itemChanged, this, &GameCheatSettingsWidget::onCheatListItemChanged); connect(m_ui.reloadCheats, &QPushButton::clicked, this, &GameCheatSettingsWidget::onReloadClicked); connect(m_ui.enableAll, &QPushButton::clicked, this, [this]() { setStateForAll(true); }); connect(m_ui.disableAll, &QPushButton::clicked, this, [this]() { setStateForAll(false); }); - connect(m_ui.allCRCsCheckbox, &QCheckBox::stateChanged, this, &GameCheatSettingsWidget::onReloadClicked); + connect(m_ui.allCRCsCheckbox, &QCheckBox::checkStateChanged, this, &GameCheatSettingsWidget::onReloadClicked); dialog->registerWidgetHelp(m_ui.allCRCsCheckbox, tr("Show Cheats For All CRCs"), tr("Checked"), tr("Toggles scanning patch files for all CRCs of the game. With this enabled available patches for the game serial with different CRCs will also be loaded.")); diff --git a/pcsx2-qt/Settings/GameListSettingsWidget.cpp b/pcsx2-qt/Settings/GameListSettingsWidget.cpp index 001b869fe5..04e690395c 100644 --- a/pcsx2-qt/Settings/GameListSettingsWidget.cpp +++ b/pcsx2-qt/Settings/GameListSettingsWidget.cpp @@ -26,7 +26,7 @@ GameListSettingsWidget::GameListSettingsWidget(SettingsWindow* dialog, QWidget* m_ui.setupUi(this); SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.preferEnglishGameList, "UI", "PreferEnglishGameList", false); - connect(m_ui.preferEnglishGameList, &QCheckBox::stateChanged, [this]{ emit preferEnglishGameListChanged(); }); + connect(m_ui.preferEnglishGameList, &QCheckBox::checkStateChanged, this, [this]{ emit preferEnglishGameListChanged(); }); dialog->registerWidgetHelp(m_ui.preferEnglishGameList, tr("Prefer English Titles"), tr("Unchecked"), tr("For games with both a title in the game's native language and one in English, prefer the English title.")); @@ -111,7 +111,7 @@ void GameListSettingsWidget::addPathToTable(const std::string& path, bool recurs m_ui.searchDirectoryList->setCellWidget(row, 1, cb); cb->setChecked(recursive); - connect(cb, &QCheckBox::stateChanged, [item](int state) { + connect(cb, &QCheckBox::checkStateChanged, this, [item](Qt::CheckState state) { const std::string path(item->text().toStdString()); if (state == Qt::Checked) { diff --git a/pcsx2-qt/Settings/GamePatchSettingsWidget.cpp b/pcsx2-qt/Settings/GamePatchSettingsWidget.cpp index d10b84a3b1..3a59da4d3b 100644 --- a/pcsx2-qt/Settings/GamePatchSettingsWidget.cpp +++ b/pcsx2-qt/Settings/GamePatchSettingsWidget.cpp @@ -31,7 +31,7 @@ GamePatchDetailsWidget::GamePatchDetailsWidget(std::string name, const std::stri pxAssert(dialog->getSettingsInterface()); m_ui.enabled->setChecked(enabled); - connect(m_ui.enabled, &QCheckBox::stateChanged, this, &GamePatchDetailsWidget::onEnabledStateChanged); + connect(m_ui.enabled, &QCheckBox::checkStateChanged, this, &GamePatchDetailsWidget::onEnabledStateChanged); } GamePatchDetailsWidget::~GamePatchDetailsWidget() = default; @@ -61,7 +61,7 @@ GamePatchSettingsWidget::GamePatchSettingsWidget(SettingsWindow* dialog, QWidget SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.allCRCsCheckbox, "EmuCore", "ShowPatchesForAllCRCs", false); connect(m_ui.reload, &QPushButton::clicked, this, &GamePatchSettingsWidget::onReloadClicked); - connect(m_ui.allCRCsCheckbox, &QCheckBox::stateChanged, this, &GamePatchSettingsWidget::reloadList); + connect(m_ui.allCRCsCheckbox, &QCheckBox::checkStateChanged, this, &GamePatchSettingsWidget::reloadList); dialog->registerWidgetHelp(m_ui.allCRCsCheckbox, tr("Show Patches For All CRCs"), tr("Checked"), tr("Toggles scanning patch files for all CRCs of the game. With this enabled available patches for the game serial with different CRCs will also be loaded.")); diff --git a/pcsx2-qt/Settings/GraphicsSettingsWidget.cpp b/pcsx2-qt/Settings/GraphicsSettingsWidget.cpp index c4b8ea4296..271bc1e279 100644 --- a/pcsx2-qt/Settings/GraphicsSettingsWidget.cpp +++ b/pcsx2-qt/Settings/GraphicsSettingsWidget.cpp @@ -135,7 +135,7 @@ GraphicsSettingsWidget::GraphicsSettingsWidget(SettingsWindow* dialog, QWidget* SettingWidgetBinder::BindWidgetToIntSetting(sif, m_ui.casMode, "EmuCore/GS", "CASMode", static_cast(GSCASMode::Disabled)); SettingWidgetBinder::BindWidgetToIntSetting(sif, m_ui.casSharpness, "EmuCore/GS", "CASSharpness", DEFAULT_CAS_SHARPNESS); - connect(m_ui.shadeBoost, QOverload::of(&QCheckBox::stateChanged), this, &GraphicsSettingsWidget::onShadeBoostChanged); + connect(m_ui.shadeBoost, &QCheckBox::checkStateChanged, this, &GraphicsSettingsWidget::onShadeBoostChanged); onShadeBoostChanged(); ////////////////////////////////////////////////////////////////////////// @@ -188,8 +188,7 @@ GraphicsSettingsWidget::GraphicsSettingsWidget(SettingsWindow* dialog, QWidget* SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.gpuPaletteConversion, "EmuCore/GS", "paltex", false); connect(m_ui.cpuSpriteRenderBW, QOverload::of(&QComboBox::currentIndexChanged), this, &GraphicsSettingsWidget::onCPUSpriteRenderBWChanged); - connect(m_ui.gpuPaletteConversion, QOverload::of(&QCheckBox::stateChanged), this, - &GraphicsSettingsWidget::onGpuPaletteConversionChanged); + connect(m_ui.gpuPaletteConversion, &QCheckBox::checkStateChanged, this, &GraphicsSettingsWidget::onGpuPaletteConversionChanged); onCPUSpriteRenderBWChanged(); onGpuPaletteConversionChanged(m_ui.gpuPaletteConversion->checkState()); @@ -273,7 +272,7 @@ GraphicsSettingsWidget::GraphicsSettingsWidget(SettingsWindow* dialog, QWidget* } connect(m_ui.renderer, QOverload::of(&QComboBox::currentIndexChanged), this, &GraphicsSettingsWidget::onRendererChanged); - connect(m_ui.enableHWFixes, &QCheckBox::stateChanged, this, &GraphicsSettingsWidget::updateRendererDependentOptions); + connect(m_ui.enableHWFixes, &QCheckBox::checkStateChanged, this, &GraphicsSettingsWidget::updateRendererDependentOptions); connect(m_ui.textureFiltering, &QComboBox::currentIndexChanged, this, &GraphicsSettingsWidget::onTextureFilteringChange); connect(m_ui.swTextureFiltering, &QComboBox::currentIndexChanged, this, &GraphicsSettingsWidget::onSWTextureFilteringChange); updateRendererDependentOptions(); @@ -366,10 +365,10 @@ GraphicsSettingsWidget::GraphicsSettingsWidget(SettingsWindow* dialog, QWidget* SettingWidgetBinder::BindWidgetToBoolSetting( sif, m_ui.enableVideoCaptureArguments, "EmuCore/GS", "EnableVideoCaptureParameters", false); SettingWidgetBinder::BindWidgetToStringSetting(sif, m_ui.videoCaptureArguments, "EmuCore/GS", "VideoCaptureParameters"); - connect(m_ui.enableVideoCapture, &QCheckBox::stateChanged, this, &GraphicsSettingsWidget::onEnableVideoCaptureChanged); + connect(m_ui.enableVideoCapture, &QCheckBox::checkStateChanged, this, &GraphicsSettingsWidget::onEnableVideoCaptureChanged); connect( - m_ui.videoCaptureResolutionAuto, &QCheckBox::stateChanged, this, &GraphicsSettingsWidget::onVideoCaptureAutoResolutionChanged); - connect(m_ui.enableVideoCaptureArguments, &QCheckBox::stateChanged, this, + m_ui.videoCaptureResolutionAuto, &QCheckBox::checkStateChanged, this, &GraphicsSettingsWidget::onVideoCaptureAutoResolutionChanged); + connect(m_ui.enableVideoCaptureArguments, &QCheckBox::checkStateChanged, this, &GraphicsSettingsWidget::onEnableVideoCaptureArgumentsChanged); SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.enableAudioCapture, "EmuCore/GS", "EnableAudioCapture", true); @@ -378,8 +377,8 @@ GraphicsSettingsWidget::GraphicsSettingsWidget(SettingsWindow* dialog, QWidget* SettingWidgetBinder::BindWidgetToBoolSetting( sif, m_ui.enableAudioCaptureArguments, "EmuCore/GS", "EnableAudioCaptureParameters", false); SettingWidgetBinder::BindWidgetToStringSetting(sif, m_ui.audioCaptureArguments, "EmuCore/GS", "AudioCaptureParameters"); - connect(m_ui.enableAudioCapture, &QCheckBox::stateChanged, this, &GraphicsSettingsWidget::onEnableAudioCaptureChanged); - connect(m_ui.enableAudioCaptureArguments, &QCheckBox::stateChanged, this, + connect(m_ui.enableAudioCapture, &QCheckBox::checkStateChanged, this, &GraphicsSettingsWidget::onEnableAudioCaptureChanged); + connect(m_ui.enableAudioCaptureArguments, &QCheckBox::checkStateChanged, this, &GraphicsSettingsWidget::onEnableAudioCaptureArgumentsChanged); onCaptureContainerChanged(); diff --git a/pcsx2-qt/Settings/InterfaceSettingsWidget.cpp b/pcsx2-qt/Settings/InterfaceSettingsWidget.cpp index edd612a7e3..d80f59f013 100644 --- a/pcsx2-qt/Settings/InterfaceSettingsWidget.cpp +++ b/pcsx2-qt/Settings/InterfaceSettingsWidget.cpp @@ -76,7 +76,7 @@ InterfaceSettingsWidget::InterfaceSettingsWidget(SettingsWindow* dialog, QWidget SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.renderToSeparateWindow, "UI", "RenderToSeparateWindow", false); SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.hideMainWindow, "UI", "HideMainWindowWhenRunning", false); SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.disableWindowResizing, "UI", "DisableWindowResize", false); - connect(m_ui.renderToSeparateWindow, &QCheckBox::stateChanged, this, &InterfaceSettingsWidget::onRenderToSeparateWindowChanged); + connect(m_ui.renderToSeparateWindow, &QCheckBox::checkStateChanged, this, &InterfaceSettingsWidget::onRenderToSeparateWindowChanged); SettingWidgetBinder::BindWidgetToEnumSetting(sif, m_ui.theme, "UI", "Theme", THEME_NAMES, THEME_VALUES, QtHost::GetDefaultThemeName(), "InterfaceSettingsWidget"); diff --git a/pcsx2-qt/Settings/MemoryCardSettingsWidget.cpp b/pcsx2-qt/Settings/MemoryCardSettingsWidget.cpp index 139760c81f..194136ec74 100644 --- a/pcsx2-qt/Settings/MemoryCardSettingsWidget.cpp +++ b/pcsx2-qt/Settings/MemoryCardSettingsWidget.cpp @@ -106,7 +106,7 @@ void MemoryCardSettingsWidget::createSlotWidgets(SlotGroup* port, u32 slot) port->enable = new QCheckBox(tr("Slot %1").arg(slot + 1), port->root); SettingWidgetBinder::BindWidgetToBoolSetting( sif, port->enable, CONFIG_SECTION, StringUtil::StdStringFromFormat("Slot%u_Enable", slot + 1), true); - connect(port->enable, &QCheckBox::stateChanged, this, &MemoryCardSettingsWidget::refresh); + connect(port->enable, &QCheckBox::checkStateChanged, this, &MemoryCardSettingsWidget::refresh); port->eject = new QToolButton(port->root); port->eject->setIcon(QIcon::fromTheme(perGame ? QStringLiteral("delete-back-2-line") : QStringLiteral("eject-line"))); diff --git a/pcsx2-qt/SetupWizardDialog.cpp b/pcsx2-qt/SetupWizardDialog.cpp index 75e234725d..8831a00d3b 100644 --- a/pcsx2-qt/SetupWizardDialog.cpp +++ b/pcsx2-qt/SetupWizardDialog.cpp @@ -318,7 +318,7 @@ void SetupWizardDialog::addPathToTable(const std::string& path, bool recursive) m_ui.searchDirectoryList->setCellWidget(row, 1, cb); cb->setChecked(recursive); - connect(cb, &QCheckBox::stateChanged, [item](int state) { + connect(cb, &QCheckBox::checkStateChanged, this, [item](Qt::CheckState state) { const std::string path(item->text().toStdString()); if (state == Qt::Checked) {