From 67e63f385cf424c7482c8842d6f13ae221d5efd1 Mon Sep 17 00:00:00 2001 From: oltolm Date: Fri, 1 Nov 2024 13:05:14 +0100 Subject: [PATCH] fix Qt6 deprecation warnings --- Source/Core/DolphinQt/Config/GameConfigWidget.cpp | 2 +- .../Core/DolphinQt/Config/Graphics/HacksWidget.cpp | 8 ++++---- .../Core/DolphinQt/Config/Mapping/MappingNumeric.cpp | 2 +- Source/Core/DolphinQt/Config/VerifyWidget.cpp | 4 ++-- Source/Core/DolphinQt/Debugger/NetworkWidget.cpp | 12 ++++++------ Source/Core/DolphinQt/NKitWarningDialog.cpp | 2 +- Source/Core/DolphinQt/NetPlay/NetPlaySetupDialog.cpp | 2 +- Source/Core/DolphinQt/NetPlay/PadMappingDialog.cpp | 2 +- Source/Core/DolphinQt/Settings/AdvancedPane.cpp | 7 ++++--- Source/Core/DolphinQt/Settings/GameCubePane.cpp | 6 +++--- Source/Core/DolphinQt/TAS/TASCheckBox.cpp | 4 ++-- Source/Core/DolphinQt/TAS/TASCheckBox.h | 2 +- 12 files changed, 27 insertions(+), 26 deletions(-) diff --git a/Source/Core/DolphinQt/Config/GameConfigWidget.cpp b/Source/Core/DolphinQt/Config/GameConfigWidget.cpp index ce56a357be..f8e0392e61 100644 --- a/Source/Core/DolphinQt/Config/GameConfigWidget.cpp +++ b/Source/Core/DolphinQt/Config/GameConfigWidget.cpp @@ -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); diff --git a/Source/Core/DolphinQt/Config/Graphics/HacksWidget.cpp b/Source/Core/DolphinQt/Config/Graphics/HacksWidget.cpp index 19712e38f8..83d218cc72 100644 --- a/Source/Core/DolphinQt/Config/Graphics/HacksWidget.cpp +++ b/Source/Core/DolphinQt/Config/Graphics/HacksWidget.cpp @@ -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(); }); } diff --git a/Source/Core/DolphinQt/Config/Mapping/MappingNumeric.cpp b/Source/Core/DolphinQt/Config/Mapping/MappingNumeric.cpp index 9a98716270..5fa518ea61 100644 --- a/Source/Core/DolphinQt/Config/Mapping/MappingNumeric.cpp +++ b/Source/Core/DolphinQt/Config/Mapping/MappingNumeric.cpp @@ -76,7 +76,7 @@ MappingBool::MappingBool(MappingWidget* parent, ControllerEmu::NumericSettingSaveSettings(); diff --git a/Source/Core/DolphinQt/Config/VerifyWidget.cpp b/Source/Core/DolphinQt/Config/VerifyWidget.cpp index 7c976092b1..09b3c25036 100644 --- a/Source/Core/DolphinQt/Config/VerifyWidget.cpp +++ b/Source/Core/DolphinQt/Config/VerifyWidget.cpp @@ -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& hash) diff --git a/Source/Core/DolphinQt/Debugger/NetworkWidget.cpp b/Source/Core/DolphinQt/Debugger/NetworkWidget.cpp index e5b91e856a..775d30d32c 100644 --- a/Source/Core/DolphinQt/Debugger/NetworkWidget.cpp +++ b/Source/Core/DolphinQt/Debugger/NetworkWidget.cpp @@ -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, [] { diff --git a/Source/Core/DolphinQt/NKitWarningDialog.cpp b/Source/Core/DolphinQt/NKitWarningDialog.cpp index 6c1bd5b117..a7d299600b 100644 --- a/Source/Core/DolphinQt/NKitWarningDialog.cpp +++ b/Source/Core/DolphinQt/NKitWarningDialog.cpp @@ -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] { diff --git a/Source/Core/DolphinQt/NetPlay/NetPlaySetupDialog.cpp b/Source/Core/DolphinQt/NetPlay/NetPlaySetupDialog.cpp index f99a493a77..df7060b6c4 100644 --- a/Source/Core/DolphinQt/NetPlay/NetPlaySetupDialog.cpp +++ b/Source/Core/DolphinQt/NetPlay/NetPlaySetupDialog.cpp @@ -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); diff --git a/Source/Core/DolphinQt/NetPlay/PadMappingDialog.cpp b/Source/Core/DolphinQt/NetPlay/PadMappingDialog.cpp index 35946d8f6d..63c852368d 100644 --- a/Source/Core/DolphinQt/NetPlay/PadMappingDialog.cpp +++ b/Source/Core/DolphinQt/NetPlay/PadMappingDialog.cpp @@ -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); } } diff --git a/Source/Core/DolphinQt/Settings/AdvancedPane.cpp b/Source/Core/DolphinQt/Settings/AdvancedPane.cpp index e15b8f2325..857ea87c5b 100644 --- a/Source/Core/DolphinQt/Settings/AdvancedPane.cpp +++ b/Source/Core/DolphinQt/Settings/AdvancedPane.cpp @@ -13,6 +13,7 @@ #include #include #include +#include #include #include @@ -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 = diff --git a/Source/Core/DolphinQt/Settings/GameCubePane.cpp b/Source/Core/DolphinQt/Settings/GameCubePane.cpp index 806e0c7840..e40aa8a1dd 100644 --- a/Source/Core/DolphinQt/Settings/GameCubePane.cpp +++ b/Source/Core/DolphinQt/Settings/GameCubePane.cpp @@ -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) diff --git a/Source/Core/DolphinQt/TAS/TASCheckBox.cpp b/Source/Core/DolphinQt/TAS/TASCheckBox.cpp index 3e7f998339..727d065d64 100644 --- a/Source/Core/DolphinQt/TAS/TASCheckBox.cpp +++ b/Source/Core/DolphinQt/TAS/TASCheckBox.cpp @@ -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); } diff --git a/Source/Core/DolphinQt/TAS/TASCheckBox.h b/Source/Core/DolphinQt/TAS/TASCheckBox.h index 3af68d43b2..c7d4e0ff67 100644 --- a/Source/Core/DolphinQt/TAS/TASCheckBox.h +++ b/Source/Core/DolphinQt/TAS/TASCheckBox.h @@ -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: