From 9c8593a84ba9405f2bd8b360f73ab06ec9057412 Mon Sep 17 00:00:00 2001 From: Reg Tiangha Date: Sat, 28 Sep 2024 18:36:58 +0200 Subject: [PATCH] configure_layout: Build fixes for QT 6.8 --- .../configuration/configure_layout.cpp | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/mandarine_qt/configuration/configure_layout.cpp b/src/mandarine_qt/configuration/configure_layout.cpp index 6681544e9..9d7c6e8b0 100644 --- a/src/mandarine_qt/configuration/configure_layout.cpp +++ b/src/mandarine_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 "common/settings.h" #include "mandarine_qt/configuration/configuration_shared.h" #include "mandarine_qt/configuration/configure_layout.h" @@ -48,6 +49,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); }); @@ -67,6 +70,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);