fix Qt6 deprecation warnings

This commit is contained in:
oltolm 2024-11-01 13:05:14 +01:00
parent 92608073ef
commit 67e63f385c
12 changed files with 27 additions and 26 deletions

View File

@ -213,7 +213,7 @@ void GameConfigWidget::ConnectWidgets()
for (QCheckBox* box :
{m_enable_dual_core, m_enable_mmu, m_enable_fprf, m_sync_gpu, m_emulate_disc_speed,
m_use_dsp_hle, m_manual_texture_sampling, m_use_monoscopic_shadows})
connect(box, &QCheckBox::stateChanged, this, &GameConfigWidget::SaveSettings);
connect(box, &QCheckBox::checkStateChanged, this, &GameConfigWidget::SaveSettings);
connect(m_deterministic_dual_core, &QComboBox::currentIndexChanged, this,
&GameConfigWidget::SaveSettings);

View File

@ -148,13 +148,13 @@ void HacksWidget::OnBackendChanged(const QString& backend_name)
void HacksWidget::ConnectWidgets()
{
connect(m_accuracy, &QSlider::valueChanged, [this](int) { SaveSettings(); });
connect(m_store_efb_copies, &QCheckBox::stateChanged,
connect(m_store_efb_copies, &QCheckBox::checkStateChanged,
[this](int) { UpdateDeferEFBCopiesEnabled(); });
connect(m_store_xfb_copies, &QCheckBox::stateChanged,
connect(m_store_xfb_copies, &QCheckBox::checkStateChanged,
[this](int) { UpdateDeferEFBCopiesEnabled(); });
connect(m_immediate_xfb, &QCheckBox::stateChanged,
connect(m_immediate_xfb, &QCheckBox::checkStateChanged,
[this](int) { UpdateSkipPresentingDuplicateFramesEnabled(); });
connect(m_vi_skip, &QCheckBox::stateChanged,
connect(m_vi_skip, &QCheckBox::checkStateChanged,
[this](int) { UpdateSkipPresentingDuplicateFramesEnabled(); });
}

View File

@ -76,7 +76,7 @@ MappingBool::MappingBool(MappingWidget* parent, ControllerEmu::NumericSetting<bo
if (const auto ui_description = m_setting.GetUIDescription())
setToolTip(tr(ui_description));
connect(this, &QCheckBox::stateChanged, this, [this, parent](int value) {
connect(this, &QCheckBox::checkStateChanged, this, [this, parent](Qt::CheckState value) {
m_setting.SetValue(value != 0);
ConfigChanged();
parent->SaveSettings();

View File

@ -121,8 +121,8 @@ void VerifyWidget::ConnectWidgets()
{
connect(m_verify_button, &QPushButton::clicked, this, &VerifyWidget::Verify);
connect(m_md5_checkbox, &QCheckBox::stateChanged, this, &VerifyWidget::UpdateRedumpEnabled);
connect(m_sha1_checkbox, &QCheckBox::stateChanged, this, &VerifyWidget::UpdateRedumpEnabled);
connect(m_md5_checkbox, &QCheckBox::checkStateChanged, this, &VerifyWidget::UpdateRedumpEnabled);
connect(m_sha1_checkbox, &QCheckBox::checkStateChanged, this, &VerifyWidget::UpdateRedumpEnabled);
}
static void SetHash(QLineEdit* line_edit, const std::vector<u8>& hash)

View File

@ -209,22 +209,22 @@ void NetworkWidget::ConnectWidgets()
{
connect(m_dump_format_combo, &QComboBox::currentIndexChanged, this,
&NetworkWidget::OnDumpFormatComboChanged);
connect(m_dump_ssl_read_checkbox, &QCheckBox::stateChanged, [](int state) {
connect(m_dump_ssl_read_checkbox, &QCheckBox::checkStateChanged, [](Qt::CheckState state) {
Config::SetBaseOrCurrent(Config::MAIN_NETWORK_SSL_DUMP_READ, state == Qt::Checked);
});
connect(m_dump_ssl_write_checkbox, &QCheckBox::stateChanged, [](int state) {
connect(m_dump_ssl_write_checkbox, &QCheckBox::checkStateChanged, [](Qt::CheckState state) {
Config::SetBaseOrCurrent(Config::MAIN_NETWORK_SSL_DUMP_WRITE, state == Qt::Checked);
});
connect(m_dump_root_ca_checkbox, &QCheckBox::stateChanged, [](int state) {
connect(m_dump_root_ca_checkbox, &QCheckBox::checkStateChanged, [](Qt::CheckState state) {
Config::SetBaseOrCurrent(Config::MAIN_NETWORK_SSL_DUMP_ROOT_CA, state == Qt::Checked);
});
connect(m_dump_peer_cert_checkbox, &QCheckBox::stateChanged, [](int state) {
connect(m_dump_peer_cert_checkbox, &QCheckBox::checkStateChanged, [](Qt::CheckState state) {
Config::SetBaseOrCurrent(Config::MAIN_NETWORK_SSL_DUMP_PEER_CERT, state == Qt::Checked);
});
connect(m_verify_certificates_checkbox, &QCheckBox::stateChanged, [](int state) {
connect(m_verify_certificates_checkbox, &QCheckBox::checkStateChanged, [](Qt::CheckState state) {
Config::SetBaseOrCurrent(Config::MAIN_NETWORK_SSL_VERIFY_CERTIFICATES, state == Qt::Checked);
});
connect(m_dump_bba_checkbox, &QCheckBox::stateChanged, [](int state) {
connect(m_dump_bba_checkbox, &QCheckBox::checkStateChanged, [](Qt::CheckState state) {
Config::SetBaseOrCurrent(Config::MAIN_NETWORK_DUMP_BBA, state == Qt::Checked);
});
connect(m_open_dump_folder, &QPushButton::clicked, [] {

View File

@ -80,7 +80,7 @@ NKitWarningDialog::NKitWarningDialog(QWidget* parent) : QDialog(parent)
connect(cancel, &QPushButton::clicked, this, &QDialog::reject);
ok->setEnabled(false);
connect(checkbox_accept, &QCheckBox::stateChanged,
connect(checkbox_accept, &QCheckBox::checkStateChanged,
[ok](int state) { ok->setEnabled(state == Qt::Checked); });
connect(this, &QDialog::accepted, [checkbox_skip] {

View File

@ -243,7 +243,7 @@ void NetPlaySetupDialog::ConnectWidgets()
&NetPlaySetupDialog::SaveSettings);
#ifdef USE_UPNP
connect(m_host_upnp, &QCheckBox::stateChanged, this, &NetPlaySetupDialog::SaveSettings);
connect(m_host_upnp, &QCheckBox::checkStateChanged, this, &NetPlaySetupDialog::SaveSettings);
#endif
connect(m_connect_button, &QPushButton::clicked, this, &QDialog::accept);

View File

@ -61,7 +61,7 @@ void PadMappingDialog::ConnectWidgets()
}
for (const auto& checkbox : m_gba_boxes)
{
connect(checkbox, &QCheckBox::stateChanged, this, &PadMappingDialog::OnMappingChanged);
connect(checkbox, &QCheckBox::checkStateChanged, this, &PadMappingDialog::OnMappingChanged);
}
}

View File

@ -13,6 +13,7 @@
#include <QRadioButton>
#include <QSignalBlocker>
#include <QSlider>
#include <QTimeZone>
#include <QVBoxLayout>
#include <cmath>
@ -170,9 +171,9 @@ void AdvancedPane::CreateLayout()
QStringLiteral("mm"), QStringLiteral("mm:ss")));
QtUtils::ShowFourDigitYear(m_custom_rtc_datetime);
m_custom_rtc_datetime->setDateTimeRange(QDateTime({2000, 1, 1}, {0, 0, 0}, Qt::UTC),
QDateTime({2099, 12, 31}, {23, 59, 59}, Qt::UTC));
m_custom_rtc_datetime->setTimeSpec(Qt::UTC);
m_custom_rtc_datetime->setDateTimeRange(QDateTime({2000, 1, 1}, {0, 0, 0}, QTimeZone::UTC),
QDateTime({2099, 12, 31}, {23, 59, 59}, QTimeZone::UTC));
m_custom_rtc_datetime->setTimeZone(QTimeZone::UTC);
rtc_options->layout()->addWidget(m_custom_rtc_datetime);
auto* custom_rtc_description =

View File

@ -247,7 +247,7 @@ void GameCubePane::CreateWidgets()
void GameCubePane::ConnectWidgets()
{
// IPL Settings
connect(m_skip_main_menu, &QCheckBox::stateChanged, this, &GameCubePane::SaveSettings);
connect(m_skip_main_menu, &QCheckBox::checkStateChanged, this, &GameCubePane::SaveSettings);
connect(m_language_combo, &QComboBox::currentIndexChanged, this, &GameCubePane::SaveSettings);
// Device Settings
@ -278,10 +278,10 @@ void GameCubePane::ConnectWidgets()
#ifdef HAS_LIBMGBA
// GBA Settings
connect(m_gba_threads, &QCheckBox::stateChanged, this, &GameCubePane::SaveSettings);
connect(m_gba_threads, &QCheckBox::checkStateChanged, this, &GameCubePane::SaveSettings);
connect(m_gba_bios_edit, &QLineEdit::editingFinished, this, &GameCubePane::SaveSettings);
connect(m_gba_browse_bios, &QPushButton::clicked, this, &GameCubePane::BrowseGBABios);
connect(m_gba_save_rom_path, &QCheckBox::stateChanged, this, &GameCubePane::SaveRomPathChanged);
connect(m_gba_save_rom_path, &QCheckBox::checkStateChanged, this, &GameCubePane::SaveRomPathChanged);
connect(m_gba_saves_edit, &QLineEdit::editingFinished, this, &GameCubePane::SaveSettings);
connect(m_gba_browse_saves, &QPushButton::clicked, this, &GameCubePane::BrowseGBASaves);
for (size_t i = 0; i < m_gba_browse_roms.size(); ++i)

View File

@ -15,7 +15,7 @@ TASCheckBox::TASCheckBox(const QString& text, TASInputWindow* parent)
{
setTristate(true);
connect(this, &TASCheckBox::stateChanged, this, &TASCheckBox::OnUIValueChanged);
connect(this, &TASCheckBox::checkStateChanged, this, &TASCheckBox::OnUIValueChanged);
}
bool TASCheckBox::GetValue() const
@ -58,7 +58,7 @@ void TASCheckBox::mousePressEvent(QMouseEvent* event)
setCheckState(Qt::PartiallyChecked);
}
void TASCheckBox::OnUIValueChanged(int new_value)
void TASCheckBox::OnUIValueChanged(Qt::CheckState new_value)
{
m_state.OnUIValueChanged(new_value);
}

View File

@ -25,7 +25,7 @@ protected:
void mousePressEvent(QMouseEvent* event) override;
private slots:
void OnUIValueChanged(int new_value);
void OnUIValueChanged(Qt::CheckState new_value);
void ApplyControllerValueChange();
private: