qt: Replace deprecated stateChanged with checkStateChanged

Updates QCheckBox signal connections to use checkStateChanged instead of
the deprecated stateChanged signal. This change affects:

- qt_controller.cpp
- configure_filesystem.cpp
- configure_input.cpp
- configure_input_advanced.cpp
- configure_system.cpp
- configure_ui.cpp
- shared_widget.cpp

Also updates lambda signatures to use Qt::CheckState instead of int for
the state parameter where needed.
This commit is contained in:
Zephyron 2025-01-27 15:36:29 +10:00
parent c36151d6e3
commit 2e4db14bc1
No known key found for this signature in database
GPG key ID: 2177ADED8AC966AF
7 changed files with 15 additions and 15 deletions

View file

@ -184,7 +184,7 @@ QtControllerSelectorDialog::QtControllerSelectorDialog(
CheckIfParametersMet(); CheckIfParametersMet();
}); });
connect(connected_controller_checkboxes[i], &QCheckBox::stateChanged, [this, i](int state) { connect(connected_controller_checkboxes[i], &QCheckBox::checkStateChanged, [this, i](Qt::CheckState state) {
player_groupboxes[i]->setChecked(state == Qt::Checked); player_groupboxes[i]->setChecked(state == Qt::Checked);
UpdateControllerIcon(i); UpdateControllerIcon(i);
UpdateControllerState(i); UpdateControllerState(i);

View file

@ -29,9 +29,9 @@ ConfigureFilesystem::ConfigureFilesystem(QWidget* parent)
connect(ui->reset_game_list_cache, &QPushButton::pressed, this, connect(ui->reset_game_list_cache, &QPushButton::pressed, this,
&ConfigureFilesystem::ResetMetadata); &ConfigureFilesystem::ResetMetadata);
connect(ui->gamecard_inserted, &QCheckBox::stateChanged, this, connect(ui->gamecard_inserted, &QCheckBox::checkStateChanged, this,
&ConfigureFilesystem::UpdateEnabledControls); &ConfigureFilesystem::UpdateEnabledControls);
connect(ui->gamecard_current_game, &QCheckBox::stateChanged, this, connect(ui->gamecard_current_game, &QCheckBox::checkStateChanged, this,
&ConfigureFilesystem::UpdateEnabledControls); &ConfigureFilesystem::UpdateEnabledControls);
} }

View file

@ -121,7 +121,7 @@ void ConfigureInput::Initialize(InputCommon::InputSubsystem* input_subsystem,
&ConfigureInput::UpdateAllInputDevices); &ConfigureInput::UpdateAllInputDevices);
connect(player_controllers[i], &ConfigureInputPlayer::RefreshInputProfiles, this, connect(player_controllers[i], &ConfigureInputPlayer::RefreshInputProfiles, this,
&ConfigureInput::UpdateAllInputProfiles, Qt::QueuedConnection); &ConfigureInput::UpdateAllInputProfiles, Qt::QueuedConnection);
connect(connected_controller_checkboxes[i], &QCheckBox::stateChanged, [this, i](int state) { connect(connected_controller_checkboxes[i], &QCheckBox::checkStateChanged, [this, i](Qt::CheckState state) {
// Keep activated controllers synced with the "Connected Controllers" checkboxes // Keep activated controllers synced with the "Connected Controllers" checkboxes
player_controllers[i]->ConnectPlayer(state == Qt::Checked); player_controllers[i]->ConnectPlayer(state == Qt::Checked);
}); });

View file

@ -74,13 +74,13 @@ ConfigureInputAdvanced::ConfigureInputAdvanced(Core::HID::HIDCore& hid_core_, QW
} }
} }
connect(ui->mouse_enabled, &QCheckBox::stateChanged, this, connect(ui->mouse_enabled, &QCheckBox::checkStateChanged, this,
&ConfigureInputAdvanced::UpdateUIEnabled); &ConfigureInputAdvanced::UpdateUIEnabled);
connect(ui->debug_enabled, &QCheckBox::stateChanged, this, connect(ui->debug_enabled, &QCheckBox::checkStateChanged, this,
&ConfigureInputAdvanced::UpdateUIEnabled); &ConfigureInputAdvanced::UpdateUIEnabled);
connect(ui->touchscreen_enabled, &QCheckBox::stateChanged, this, connect(ui->touchscreen_enabled, &QCheckBox::checkStateChanged, this,
&ConfigureInputAdvanced::UpdateUIEnabled); &ConfigureInputAdvanced::UpdateUIEnabled);
connect(ui->enable_ring_controller, &QCheckBox::stateChanged, this, connect(ui->enable_ring_controller, &QCheckBox::checkStateChanged, this,
&ConfigureInputAdvanced::UpdateUIEnabled); &ConfigureInputAdvanced::UpdateUIEnabled);
connect(ui->debug_configure, &QPushButton::clicked, this, connect(ui->debug_configure, &QPushButton::clicked, this,

View file

@ -83,7 +83,7 @@ ConfigureSystem::ConfigureSystem(Core::System& system_,
connect(combo_language, qOverload<int>(&QComboBox::currentIndexChanged), this, locale_check); connect(combo_language, qOverload<int>(&QComboBox::currentIndexChanged), this, locale_check);
connect(combo_region, qOverload<int>(&QComboBox::currentIndexChanged), this, locale_check); connect(combo_region, qOverload<int>(&QComboBox::currentIndexChanged), this, locale_check);
connect(checkbox_rtc, qOverload<int>(&QCheckBox::stateChanged), this, update_rtc_date); connect(checkbox_rtc, &QCheckBox::checkStateChanged, this, update_rtc_date);
connect(date_rtc_offset, qOverload<int>(&QSpinBox::valueChanged), this, update_rtc_date); connect(date_rtc_offset, qOverload<int>(&QSpinBox::valueChanged), this, update_rtc_date);
connect(date_rtc, &QDateTimeEdit::dateTimeChanged, this, update_date_offset); connect(date_rtc, &QDateTimeEdit::dateTimeChanged, this, update_date_offset);

View file

@ -119,11 +119,11 @@ ConfigureUi::ConfigureUi(Core::System& system_, QWidget* parent)
SetConfiguration(); SetConfiguration();
// Force game list reload if any of the relevant settings are changed. // Force game list reload if any of the relevant settings are changed.
connect(ui->show_add_ons, &QCheckBox::stateChanged, this, &ConfigureUi::RequestGameListUpdate); connect(ui->show_add_ons, &QCheckBox::checkStateChanged, this, &ConfigureUi::RequestGameListUpdate);
connect(ui->show_compat, &QCheckBox::stateChanged, this, &ConfigureUi::RequestGameListUpdate); connect(ui->show_compat, &QCheckBox::checkStateChanged, this, &ConfigureUi::RequestGameListUpdate);
connect(ui->show_size, &QCheckBox::stateChanged, this, &ConfigureUi::RequestGameListUpdate); connect(ui->show_size, &QCheckBox::checkStateChanged, this, &ConfigureUi::RequestGameListUpdate);
connect(ui->show_types, &QCheckBox::stateChanged, this, &ConfigureUi::RequestGameListUpdate); connect(ui->show_types, &QCheckBox::checkStateChanged, this, &ConfigureUi::RequestGameListUpdate);
connect(ui->show_play_time, &QCheckBox::stateChanged, this, connect(ui->show_play_time, &QCheckBox::checkStateChanged, this,
&ConfigureUi::RequestGameListUpdate); &ConfigureUi::RequestGameListUpdate);
connect(ui->game_icon_size_combobox, QOverload<int>::of(&QComboBox::currentIndexChanged), this, connect(ui->game_icon_size_combobox, QOverload<int>::of(&QComboBox::currentIndexChanged), this,
&ConfigureUi::RequestGameListUpdate); &ConfigureUi::RequestGameListUpdate);

View file

@ -699,7 +699,7 @@ void Widget::SetupComponent(const QString& label, std::function<void()>& load_fu
restore_func(); restore_func();
} }
}; };
connect(checkbox, &QCheckBox::stateChanged, reset); connect(checkbox, &QCheckBox::checkStateChanged, reset);
reset(checkbox->checkState()); reset(checkbox->checkState());
} }
} }