From ca51145be915d820bd17f75f7ec822d03574a1f3 Mon Sep 17 00:00:00 2001 From: pifopi Date: Sun, 1 Dec 2024 16:56:53 +0100 Subject: [PATCH] update qt version for CI --- .github/workflows/cpp-ci-serial-programs.yml | 6 +++--- Common/Qt/Options/BooleanCheckBoxWidget.cpp | 11 ++++++++++- .../Framework/UI/NintendoSwitch_CommandRow.cpp | 15 +++++++++++++++ 3 files changed, 28 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cpp-ci-serial-programs.yml b/.github/workflows/cpp-ci-serial-programs.yml index 075c9ea6e..796271668 100644 --- a/.github/workflows/cpp-ci-serial-programs.yml +++ b/.github/workflows/cpp-ci-serial-programs.yml @@ -10,13 +10,13 @@ jobs: fail-fast: false matrix: os: [windows-2022, macos-13, ubuntu-24.04] - qt_version: ['5.12.12', '6.7.2'] + qt_version: ['5.12.12', '6.8.1'] include: - qt_version: '5.12.12' qt_version_major: '5' qt_modules: '' - - qt_version: '6.7.2' + - qt_version: '6.8.1' qt_version_major: '6' qt_modules: 'qtmultimedia qtserialport' @@ -37,7 +37,7 @@ jobs: if: startsWith(matrix.os, 'mac') run: | brew install opencv - - uses: jurplel/install-qt-action@v3 + - uses: jurplel/install-qt-action@v4 with: version: ${{ matrix.qt_version }} modules: ${{ matrix.qt_modules }} diff --git a/Common/Qt/Options/BooleanCheckBoxWidget.cpp b/Common/Qt/Options/BooleanCheckBoxWidget.cpp index b8848ca91..852f9aff1 100644 --- a/Common/Qt/Options/BooleanCheckBoxWidget.cpp +++ b/Common/Qt/Options/BooleanCheckBoxWidget.cpp @@ -38,12 +38,21 @@ BooleanCheckBoxCellWidget::BooleanCheckBoxCellWidget(QWidget& parent, BooleanChe m_box = new QCheckBox(this); m_box->setChecked(m_value); layout->addWidget(m_box); +#if QT_VERSION < 0x060700 connect( m_box, &QCheckBox::stateChanged, this, [this](int){ m_value = m_box->isChecked(); } ); +#else + connect( + m_box, &QCheckBox::checkStateChanged, + this, [this](Qt::CheckState){ + m_value = m_box->isChecked(); + } + ); +#endif value.add_listener(*this); } void BooleanCheckBoxCellWidget::update_value(){ @@ -82,7 +91,7 @@ BooleanCheckBoxOptionWidget::BooleanCheckBoxOptionWidget(QWidget& parent, Boolea m_box->setChecked(m_value); layout->addWidget(m_box, 1); connect( - m_box, &QCheckBox::stateChanged, + m_box, &QCheckBox::checkStateChanged, this, [this](int){ m_value = m_box->isChecked(); } diff --git a/SerialPrograms/Source/NintendoSwitch/Framework/UI/NintendoSwitch_CommandRow.cpp b/SerialPrograms/Source/NintendoSwitch/Framework/UI/NintendoSwitch_CommandRow.cpp index 01f0ba273..e1c5a1b19 100644 --- a/SerialPrograms/Source/NintendoSwitch/Framework/UI/NintendoSwitch_CommandRow.cpp +++ b/SerialPrograms/Source/NintendoSwitch/Framework/UI/NintendoSwitch_CommandRow.cpp @@ -79,6 +79,7 @@ CommandRow::CommandRow( m_overlay_boxes, &QCheckBox::clicked, this, [this](bool checked){ m_session.set_enabled_boxes(checked); } ); +#if QT_VERSION < 0x060700 connect( m_overlay_text, &QCheckBox::stateChanged, this, [this](bool checked){ m_session.set_enabled_text(checked); } @@ -91,6 +92,20 @@ CommandRow::CommandRow( m_overlay_stats, &QCheckBox::stateChanged, this, [this](bool checked){ m_session.set_enabled_stats(checked); } ); +#else + connect( + m_overlay_text, &QCheckBox::checkStateChanged, + this, [this](Qt::CheckState state){ m_session.set_enabled_text(state == Qt::Checked); } + ); + connect( + m_overlay_log, &QCheckBox::checkStateChanged, + this, [this](Qt::CheckState state){ m_session.set_enabled_log(state == Qt::Checked); } + ); + connect( + m_overlay_stats, &QCheckBox::checkStateChanged, + this, [this](Qt::CheckState state){ m_session.set_enabled_stats(state == Qt::Checked); } + ); +#endif connect( m_load_profile_button, &QPushButton::clicked, this, [this](bool) { emit load_profile(); }