From cbf0d3da52efbff2a945f773735ae4678ec29a7a Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 21 Feb 2025 11:42:03 -0500 Subject: [PATCH] cmake-gui: Port away from deprecated API in Qt >= 6.7 --- Source/QtDialog/WarningMessagesDialog.cxx | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/Source/QtDialog/WarningMessagesDialog.cxx b/Source/QtDialog/WarningMessagesDialog.cxx index 1fcf2b1a48..e409768165 100644 --- a/Source/QtDialog/WarningMessagesDialog.cxx +++ b/Source/QtDialog/WarningMessagesDialog.cxx @@ -26,21 +26,23 @@ void WarningMessagesDialog::setInitialValues() void WarningMessagesDialog::setupSignals() { +#if (QT_VERSION >= QT_VERSION_CHECK(6, 7, 0)) + static auto const checkStateChanged = &QCheckBox::checkStateChanged; +#else + static auto const checkStateChanged = &QCheckBox::stateChanged; +#endif QObject::connect(this->buttonBox, &QDialogButtonBox::accepted, this, &WarningMessagesDialog::doAccept); - - QObject::connect(this->suppressDeveloperWarnings, &QCheckBox::stateChanged, - this, + QObject::connect(this->suppressDeveloperWarnings, checkStateChanged, this, &WarningMessagesDialog::doSuppressDeveloperWarningsChanged); QObject::connect( - this->suppressDeprecatedWarnings, &QCheckBox::stateChanged, this, + this->suppressDeprecatedWarnings, checkStateChanged, this, &WarningMessagesDialog::doSuppressDeprecatedWarningsChanged); - QObject::connect(this->developerWarningsAsErrors, &QCheckBox::stateChanged, - this, + QObject::connect(this->developerWarningsAsErrors, checkStateChanged, this, &WarningMessagesDialog::doDeveloperWarningsAsErrorsChanged); QObject::connect( - this->deprecatedWarningsAsErrors, &QCheckBox::stateChanged, this, + this->deprecatedWarningsAsErrors, checkStateChanged, this, &WarningMessagesDialog::doDeprecatedWarningsAsErrorsChanged); }