From 70f01e84759415b084c301fd0592ebe5cf5ed800 Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Tue, 15 Oct 2024 00:16:20 +0200 Subject: [PATCH] audqt: Fix deprecation warnings See also: https://doc.qt.io/qt-6/qcheckbox.html#signals --- src/libaudqt/equalizer-qt.cc | 4 ++++ src/libaudqt/playlist-management.cc | 4 ++++ src/libaudqt/prefs-widget-qt.cc | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/src/libaudqt/equalizer-qt.cc b/src/libaudqt/equalizer-qt.cc index df8257a7e..2cae65f57 100644 --- a/src/libaudqt/equalizer-qt.cc +++ b/src/libaudqt/equalizer-qt.cc @@ -162,7 +162,11 @@ EqualizerWindow::EqualizerWindow() updatePreamp(); updateBands(); +#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) + connect(&m_onoff_checkbox, &QCheckBox::checkStateChanged, [](Qt::CheckState state) { +#else connect(&m_onoff_checkbox, &QCheckBox::stateChanged, [](int state) { +#endif aud_set_bool("equalizer_active", (state == Qt::Checked)); }); diff --git a/src/libaudqt/playlist-management.cc b/src/libaudqt/playlist-management.cc index 2e7eb856f..1d1f72521 100644 --- a/src/libaudqt/playlist-management.cc +++ b/src/libaudqt/playlist-management.cc @@ -73,7 +73,11 @@ static QDialog * buildDeleteDialog(Playlist playlist) remove->setIcon(QIcon::fromTheme("edit-delete")); cancel->setIcon(QIcon::fromTheme("process-stop")); +#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) + QObject::connect(skip_prompt, &QCheckBox::checkStateChanged, [](Qt::CheckState state) { +#else QObject::connect(skip_prompt, &QCheckBox::stateChanged, [](int state) { +#endif aud_set_bool("audgui", "no_confirm_playlist_delete", (state == Qt::Checked)); }); diff --git a/src/libaudqt/prefs-widget-qt.cc b/src/libaudqt/prefs-widget-qt.cc index b10a03083..c147c3310 100644 --- a/src/libaudqt/prefs-widget-qt.cc +++ b/src/libaudqt/prefs-widget-qt.cc @@ -68,7 +68,11 @@ BooleanWidget::BooleanWidget(const PreferencesWidget * parent, { update(); +#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) + QObject::connect(this, &QCheckBox::checkStateChanged, [this](Qt::CheckState state) { +#else QObject::connect(this, &QCheckBox::stateChanged, [this](int state) { +#endif if (m_updating) return; m_parent->cfg.set_bool(state != Qt::Unchecked);