diff --git a/Source/Core/DolphinQt/Config/Graphics/HacksWidget.cpp b/Source/Core/DolphinQt/Config/Graphics/HacksWidget.cpp index 0ac50ac38d..6d1108774a 100644 --- a/Source/Core/DolphinQt/Config/Graphics/HacksWidget.cpp +++ b/Source/Core/DolphinQt/Config/Graphics/HacksWidget.cpp @@ -140,6 +140,16 @@ void HacksWidget::OnBackendChanged(const QString& backend_name) void HacksWidget::ConnectWidgets() { +#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) + connect(m_store_efb_copies, &QCheckBox::checkStateChanged, + [this](Qt::CheckState) { UpdateDeferEFBCopiesEnabled(); }); + connect(m_store_xfb_copies, &QCheckBox::checkStateChanged, + [this](Qt::CheckState) { UpdateDeferEFBCopiesEnabled(); }); + connect(m_immediate_xfb, &QCheckBox::checkStateChanged, + [this](Qt::CheckState) { UpdateSkipPresentingDuplicateFramesEnabled(); }); + connect(m_vi_skip, &QCheckBox::checkStateChanged, + [this](Qt::CheckState) { UpdateSkipPresentingDuplicateFramesEnabled(); }); +#else connect(m_store_efb_copies, &QCheckBox::stateChanged, [this](int) { UpdateDeferEFBCopiesEnabled(); }); connect(m_store_xfb_copies, &QCheckBox::stateChanged, @@ -148,6 +158,7 @@ void HacksWidget::ConnectWidgets() [this](int) { UpdateSkipPresentingDuplicateFramesEnabled(); }); connect(m_vi_skip, &QCheckBox::stateChanged, [this](int) { UpdateSkipPresentingDuplicateFramesEnabled(); }); +#endif } void HacksWidget::AddDescriptions() diff --git a/Source/Core/DolphinQt/Config/Mapping/MappingNumeric.cpp b/Source/Core/DolphinQt/Config/Mapping/MappingNumeric.cpp index 9a98716270..c6e05abd4e 100644 --- a/Source/Core/DolphinQt/Config/Mapping/MappingNumeric.cpp +++ b/Source/Core/DolphinQt/Config/Mapping/MappingNumeric.cpp @@ -76,7 +76,11 @@ MappingBool::MappingBool(MappingWidget* parent, ControllerEmu::NumericSetting= QT_VERSION_CHECK(6, 7, 0) + connect(this, &QCheckBox::checkStateChanged, this, [this, parent](Qt::CheckState value) { +#else connect(this, &QCheckBox::stateChanged, this, [this, parent](int value) { +#endif m_setting.SetValue(value != 0); ConfigChanged(); parent->SaveSettings(); diff --git a/Source/Core/DolphinQt/Config/VerifyWidget.cpp b/Source/Core/DolphinQt/Config/VerifyWidget.cpp index a4f2e4081b..42835fd673 100644 --- a/Source/Core/DolphinQt/Config/VerifyWidget.cpp +++ b/Source/Core/DolphinQt/Config/VerifyWidget.cpp @@ -120,8 +120,13 @@ void VerifyWidget::ConnectWidgets() { connect(m_verify_button, &QPushButton::clicked, this, &VerifyWidget::Verify); +#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) + connect(m_md5_checkbox, &QCheckBox::checkStateChanged, this, &VerifyWidget::UpdateRedumpEnabled); + connect(m_sha1_checkbox, &QCheckBox::checkStateChanged, this, &VerifyWidget::UpdateRedumpEnabled); +#else connect(m_md5_checkbox, &QCheckBox::stateChanged, this, &VerifyWidget::UpdateRedumpEnabled); connect(m_sha1_checkbox, &QCheckBox::stateChanged, this, &VerifyWidget::UpdateRedumpEnabled); +#endif } static void SetHash(QLineEdit* line_edit, const std::vector& hash) diff --git a/Source/Core/DolphinQt/Debugger/MemoryViewWidget.cpp b/Source/Core/DolphinQt/Debugger/MemoryViewWidget.cpp index ef39421294..ca94fafa21 100644 --- a/Source/Core/DolphinQt/Debugger/MemoryViewWidget.cpp +++ b/Source/Core/DolphinQt/Debugger/MemoryViewWidget.cpp @@ -884,7 +884,11 @@ std::vector MemoryViewWidget::ConvertTextToBytes(Type type, QStringView inpu // Confirm it is only hex bytes const QRegularExpression is_hex(QStringLiteral("^([0-9A-F]{2})*$"), QRegularExpression::CaseInsensitiveOption); +#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0) + const QRegularExpressionMatch match = is_hex.matchView(input_text); +#else const QRegularExpressionMatch match = is_hex.match(input_text); +#endif good = match.hasMatch(); if (good) { diff --git a/Source/Core/DolphinQt/Debugger/NetworkWidget.cpp b/Source/Core/DolphinQt/Debugger/NetworkWidget.cpp index e5b91e856a..3d75cca71d 100644 --- a/Source/Core/DolphinQt/Debugger/NetworkWidget.cpp +++ b/Source/Core/DolphinQt/Debugger/NetworkWidget.cpp @@ -209,6 +209,26 @@ void NetworkWidget::ConnectWidgets() { connect(m_dump_format_combo, &QComboBox::currentIndexChanged, this, &NetworkWidget::OnDumpFormatComboChanged); +#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) + 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::checkStateChanged, [](Qt::CheckState state) { + Config::SetBaseOrCurrent(Config::MAIN_NETWORK_SSL_DUMP_WRITE, state == Qt::Checked); + }); + 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::checkStateChanged, [](Qt::CheckState state) { + Config::SetBaseOrCurrent(Config::MAIN_NETWORK_SSL_DUMP_PEER_CERT, state == Qt::Checked); + }); + 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::checkStateChanged, [](Qt::CheckState state) { + Config::SetBaseOrCurrent(Config::MAIN_NETWORK_DUMP_BBA, state == Qt::Checked); + }); +#else connect(m_dump_ssl_read_checkbox, &QCheckBox::stateChanged, [](int state) { Config::SetBaseOrCurrent(Config::MAIN_NETWORK_SSL_DUMP_READ, state == Qt::Checked); }); @@ -227,6 +247,7 @@ void NetworkWidget::ConnectWidgets() connect(m_dump_bba_checkbox, &QCheckBox::stateChanged, [](int state) { Config::SetBaseOrCurrent(Config::MAIN_NETWORK_DUMP_BBA, state == Qt::Checked); }); +#endif connect(m_open_dump_folder, &QPushButton::clicked, [] { const std::string location = File::GetUserPath(D_DUMPSSL_IDX); const QUrl url = QUrl::fromLocalFile(QString::fromStdString(location)); diff --git a/Source/Core/DolphinQt/NKitWarningDialog.cpp b/Source/Core/DolphinQt/NKitWarningDialog.cpp index 5bea5e69a4..0b16e4f0aa 100644 --- a/Source/Core/DolphinQt/NKitWarningDialog.cpp +++ b/Source/Core/DolphinQt/NKitWarningDialog.cpp @@ -77,8 +77,13 @@ NKitWarningDialog::NKitWarningDialog(QWidget* parent) : QDialog(parent) connect(cancel, &QPushButton::clicked, this, &QDialog::reject); ok->setEnabled(false); +#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) + connect(checkbox_accept, &QCheckBox::checkStateChanged, + [ok](Qt::CheckState state) { ok->setEnabled(state == Qt::Checked); }); +#else connect(checkbox_accept, &QCheckBox::stateChanged, [ok](int state) { ok->setEnabled(state == Qt::Checked); }); +#endif connect(this, &QDialog::accepted, [checkbox_skip] { Config::SetBase(Config::MAIN_SKIP_NKIT_WARNING, checkbox_skip->isChecked()); diff --git a/Source/Core/DolphinQt/NetPlay/NetPlaySetupDialog.cpp b/Source/Core/DolphinQt/NetPlay/NetPlaySetupDialog.cpp index 9188768229..9b41890b96 100644 --- a/Source/Core/DolphinQt/NetPlay/NetPlaySetupDialog.cpp +++ b/Source/Core/DolphinQt/NetPlay/NetPlaySetupDialog.cpp @@ -242,7 +242,11 @@ void NetPlaySetupDialog::ConnectWidgets() &NetPlaySetupDialog::SaveSettings); #ifdef USE_UPNP +#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) + connect(m_host_upnp, &QCheckBox::checkStateChanged, this, &NetPlaySetupDialog::SaveSettings); +#else connect(m_host_upnp, &QCheckBox::stateChanged, this, &NetPlaySetupDialog::SaveSettings); +#endif #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 cd7c4d893b..a1525d0376 100644 --- a/Source/Core/DolphinQt/NetPlay/PadMappingDialog.cpp +++ b/Source/Core/DolphinQt/NetPlay/PadMappingDialog.cpp @@ -60,7 +60,11 @@ void PadMappingDialog::ConnectWidgets() } for (const auto& checkbox : m_gba_boxes) { +#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) + connect(checkbox, &QCheckBox::checkStateChanged, this, &PadMappingDialog::OnMappingChanged); +#else connect(checkbox, &QCheckBox::stateChanged, this, &PadMappingDialog::OnMappingChanged); +#endif } } diff --git a/Source/Core/DolphinQt/Settings/AdvancedPane.cpp b/Source/Core/DolphinQt/Settings/AdvancedPane.cpp index 3a8251ae83..10534ca3cb 100644 --- a/Source/Core/DolphinQt/Settings/AdvancedPane.cpp +++ b/Source/Core/DolphinQt/Settings/AdvancedPane.cpp @@ -12,6 +12,7 @@ #include #include #include +#include #include #include @@ -251,9 +252,18 @@ void AdvancedPane::CreateLayout() QStringLiteral("mm"), QStringLiteral("mm:ss"))); QtUtils::ShowFourDigitYear(m_custom_rtc_datetime); +#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0) + m_custom_rtc_datetime->setDateTimeRange(QDateTime({2000, 1, 1}, {0, 0, 0}, QTimeZone::UTC), + QDateTime({2099, 12, 31}, {23, 59, 59}, QTimeZone::UTC)); +#else m_custom_rtc_datetime->setDateTimeRange(QDateTime({2000, 1, 1}, {0, 0, 0}, Qt::UTC), QDateTime({2099, 12, 31}, {23, 59, 59}, Qt::UTC)); +#endif +#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) + m_custom_rtc_datetime->setTimeZone(QTimeZone::UTC); +#else m_custom_rtc_datetime->setTimeSpec(Qt::UTC); +#endif rtc_options->layout()->addWidget(m_custom_rtc_datetime); m_custom_rtc_checkbox->SetDescription( diff --git a/Source/Core/DolphinQt/Settings/GameCubePane.cpp b/Source/Core/DolphinQt/Settings/GameCubePane.cpp index 8c5d306988..042002f003 100644 --- a/Source/Core/DolphinQt/Settings/GameCubePane.cpp +++ b/Source/Core/DolphinQt/Settings/GameCubePane.cpp @@ -241,7 +241,11 @@ void GameCubePane::CreateWidgets() void GameCubePane::ConnectWidgets() { // IPL Settings +#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) + connect(m_skip_main_menu, &QCheckBox::checkStateChanged, this, &GameCubePane::SaveSettings); +#else connect(m_skip_main_menu, &QCheckBox::stateChanged, this, &GameCubePane::SaveSettings); +#endif connect(m_language_combo, &QComboBox::currentIndexChanged, this, &GameCubePane::SaveSettings); // Device Settings @@ -272,10 +276,20 @@ void GameCubePane::ConnectWidgets() #ifdef HAS_LIBMGBA // GBA Settings + +#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) + connect(m_gba_threads, &QCheckBox::checkStateChanged, this, &GameCubePane::SaveSettings); +#else connect(m_gba_threads, &QCheckBox::stateChanged, this, &GameCubePane::SaveSettings); +#endif connect(m_gba_bios_edit, &QLineEdit::editingFinished, this, &GameCubePane::SaveSettings); connect(m_gba_browse_bios, &QPushButton::clicked, this, &GameCubePane::BrowseGBABios); +#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) + connect(m_gba_save_rom_path, &QCheckBox::checkStateChanged, this, + &GameCubePane::SaveRomPathChanged); +#else connect(m_gba_save_rom_path, &QCheckBox::stateChanged, this, &GameCubePane::SaveRomPathChanged); +#endif 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..8ea157f865 100644 --- a/Source/Core/DolphinQt/TAS/TASCheckBox.cpp +++ b/Source/Core/DolphinQt/TAS/TASCheckBox.cpp @@ -15,7 +15,11 @@ TASCheckBox::TASCheckBox(const QString& text, TASInputWindow* parent) { setTristate(true); +#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) + connect(this, &TASCheckBox::checkStateChanged, this, &TASCheckBox::OnUIValueChanged); +#else connect(this, &TASCheckBox::stateChanged, this, &TASCheckBox::OnUIValueChanged); +#endif } bool TASCheckBox::GetValue() const @@ -58,7 +62,11 @@ void TASCheckBox::mousePressEvent(QMouseEvent* event) setCheckState(Qt::PartiallyChecked); } +#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) +void TASCheckBox::OnUIValueChanged(Qt::CheckState new_value) +#else void TASCheckBox::OnUIValueChanged(int new_value) +#endif { m_state.OnUIValueChanged(new_value); } diff --git a/Source/Core/DolphinQt/TAS/TASCheckBox.h b/Source/Core/DolphinQt/TAS/TASCheckBox.h index 3af68d43b2..a02dbae72f 100644 --- a/Source/Core/DolphinQt/TAS/TASCheckBox.h +++ b/Source/Core/DolphinQt/TAS/TASCheckBox.h @@ -25,7 +25,11 @@ protected: void mousePressEvent(QMouseEvent* event) override; private slots: +#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) + void OnUIValueChanged(Qt::CheckState new_value); +#else void OnUIValueChanged(int new_value); +#endif void ApplyControllerValueChange(); private: