From 19eeb949a1ddfed86c2d5606afac5af5dd1aee61 Mon Sep 17 00:00:00 2001 From: Reg Tiangha Date: Tue, 15 Oct 2024 04:40:46 -0600 Subject: [PATCH] citra_qt: Build fixes for QT 6.8 (#441) * citra_qt: Build fixes for QT 6.8 Replace deprecated `stateChanged` function with `checkStateChanged` that was first introduced in QT 6.7. * citra_qt: Use macros to detect QT version * citra_qt: Group QT macro version checks together --- .../configuration/configure_camera.cpp | 2 +- .../configuration/configure_cheats.cpp | 2 +- .../configuration/configure_layout.cpp | 22 ++++++++++++++++++- src/citra_qt/debugger/ipc/recorder.cpp | 2 +- 4 files changed, 24 insertions(+), 4 deletions(-) diff --git a/src/citra_qt/configuration/configure_camera.cpp b/src/citra_qt/configuration/configure_camera.cpp index d367e433a..a92bb70ae 100644 --- a/src/citra_qt/configuration/configure_camera.cpp +++ b/src/citra_qt/configuration/configure_camera.cpp @@ -1,4 +1,4 @@ -// Copyright 2018 Citra Emulator Project +// Copyright Citra Emulator Project / Lime3DS Emulator Project // Licensed under GPLv2 or any later version // Refer to the license.txt file included. diff --git a/src/citra_qt/configuration/configure_cheats.cpp b/src/citra_qt/configuration/configure_cheats.cpp index 20381853a..a4ba9c856 100644 --- a/src/citra_qt/configuration/configure_cheats.cpp +++ b/src/citra_qt/configuration/configure_cheats.cpp @@ -1,4 +1,4 @@ -// Copyright 2018 Citra Emulator Project +// Copyright Citra Emulator Project / Lime3DS Emulator Project // Licensed under GPLv2 or any later version // Refer to the license.txt file included. diff --git a/src/citra_qt/configuration/configure_layout.cpp b/src/citra_qt/configuration/configure_layout.cpp index c638836c8..cc78d8948 100644 --- a/src/citra_qt/configuration/configure_layout.cpp +++ b/src/citra_qt/configuration/configure_layout.cpp @@ -1,8 +1,9 @@ -// Copyright 2019 Citra Emulator Project +// Copyright Citra Emulator Project / Lime3DS Emulator Project // Licensed under GPLv2 or any later version // Refer to the license.txt file included. #include +#include #include "citra_qt/configuration/configuration_shared.h" #include "citra_qt/configuration/configure_layout.h" #include "common/settings.h" @@ -57,6 +58,8 @@ ConfigureLayout::ConfigureLayout(QWidget* parent) }); ui->screen_top_leftright_padding->setEnabled(Settings::values.screen_top_stretch.GetValue()); + +#if QT_VERSION < QT_VERSION_CHECK(6, 7, 0) connect(ui->screen_top_stretch, static_cast(&QCheckBox::stateChanged), this, [this](bool checkState) { ui->screen_top_leftright_padding->setEnabled(checkState); }); @@ -76,6 +79,23 @@ ConfigureLayout::ConfigureLayout(QWidget* parent) ui->screen_bottom_stretch, static_cast(&QCheckBox::stateChanged), this, [this](bool checkState) { ui->screen_bottom_topbottom_padding->setEnabled(checkState); }); +#else + connect(ui->screen_top_stretch, &QCheckBox::checkStateChanged, this, + [this](bool checkState) { ui->screen_top_leftright_padding->setEnabled(checkState); }); + ui->screen_top_topbottom_padding->setEnabled(Settings::values.screen_top_stretch.GetValue()); + connect(ui->screen_top_stretch, &QCheckBox::checkStateChanged, this, + [this](bool checkState) { ui->screen_top_topbottom_padding->setEnabled(checkState); }); + ui->screen_bottom_leftright_padding->setEnabled( + Settings::values.screen_bottom_topbottom_padding.GetValue()); + connect( + ui->screen_bottom_stretch, &QCheckBox::checkStateChanged, this, + [this](bool checkState) { ui->screen_bottom_leftright_padding->setEnabled(checkState); }); + ui->screen_bottom_topbottom_padding->setEnabled( + Settings::values.screen_bottom_topbottom_padding.GetValue()); + connect( + ui->screen_bottom_stretch, &QCheckBox::checkStateChanged, this, + [this](bool checkState) { ui->screen_bottom_topbottom_padding->setEnabled(checkState); }); +#endif connect(ui->bg_button, &QPushButton::clicked, this, [this] { const QColor new_bg_color = QColorDialog::getColor(bg_color); diff --git a/src/citra_qt/debugger/ipc/recorder.cpp b/src/citra_qt/debugger/ipc/recorder.cpp index 3a9bc8a95..f0a9973c5 100644 --- a/src/citra_qt/debugger/ipc/recorder.cpp +++ b/src/citra_qt/debugger/ipc/recorder.cpp @@ -1,4 +1,4 @@ -// Copyright 2019 Citra Emulator Project +// Copyright Citra Emulator Project / Lime3DS Emulator Project // Licensed under GPLv2 or any later version // Refer to the license.txt file included.