mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-08 14:50:10 -06:00
cmake-gui: Clarify signature of QCheckBox::checkStateChanged callbacks
In commit cbf0d3da52 (cmake-gui: Port away from deprecated API in Qt >=
6.7, 2025-02-21, v4.1.0-rc1~755^2~4) we assumed that `Qt::CheckState` is
implemented as an `int`. Spell out the type explicitly for the Qt 6.7+
callback signatures.
This commit is contained in:
@@ -26,7 +26,7 @@ void WarningMessagesDialog::setInitialValues()
|
||||
|
||||
void WarningMessagesDialog::setupSignals()
|
||||
{
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(6, 7, 0))
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0)
|
||||
static auto const checkStateChanged = &QCheckBox::checkStateChanged;
|
||||
#else
|
||||
static auto const checkStateChanged = &QCheckBox::stateChanged;
|
||||
@@ -59,7 +59,8 @@ void WarningMessagesDialog::doAccept()
|
||||
this->deprecatedWarningsAsErrors->isChecked());
|
||||
}
|
||||
|
||||
void WarningMessagesDialog::doSuppressDeveloperWarningsChanged(int state)
|
||||
void WarningMessagesDialog::doSuppressDeveloperWarningsChanged(
|
||||
CheckState state)
|
||||
{
|
||||
// no warnings implies no errors either
|
||||
if (state) {
|
||||
@@ -67,7 +68,8 @@ void WarningMessagesDialog::doSuppressDeveloperWarningsChanged(int state)
|
||||
}
|
||||
}
|
||||
|
||||
void WarningMessagesDialog::doSuppressDeprecatedWarningsChanged(int state)
|
||||
void WarningMessagesDialog::doSuppressDeprecatedWarningsChanged(
|
||||
CheckState state)
|
||||
{
|
||||
// no warnings implies no errors either
|
||||
if (state) {
|
||||
@@ -75,7 +77,8 @@ void WarningMessagesDialog::doSuppressDeprecatedWarningsChanged(int state)
|
||||
}
|
||||
}
|
||||
|
||||
void WarningMessagesDialog::doDeveloperWarningsAsErrorsChanged(int state)
|
||||
void WarningMessagesDialog::doDeveloperWarningsAsErrorsChanged(
|
||||
CheckState state)
|
||||
{
|
||||
// warnings as errors implies warnings are not suppressed
|
||||
if (state) {
|
||||
@@ -83,7 +86,8 @@ void WarningMessagesDialog::doDeveloperWarningsAsErrorsChanged(int state)
|
||||
}
|
||||
}
|
||||
|
||||
void WarningMessagesDialog::doDeprecatedWarningsAsErrorsChanged(int state)
|
||||
void WarningMessagesDialog::doDeprecatedWarningsAsErrorsChanged(
|
||||
CheckState state)
|
||||
{
|
||||
// warnings as errors implies warnings are not suppressed
|
||||
if (state) {
|
||||
|
||||
@@ -17,6 +17,12 @@ class WarningMessagesDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0)
|
||||
using CheckState = Qt::CheckState;
|
||||
#else
|
||||
using CheckState = int;
|
||||
#endif
|
||||
|
||||
public:
|
||||
WarningMessagesDialog(QWidget* prnt, QCMake* instance);
|
||||
|
||||
@@ -30,23 +36,23 @@ private slots:
|
||||
* Handler for checked state changed event of the suppress developer warnings
|
||||
* checkbox.
|
||||
*/
|
||||
void doSuppressDeveloperWarningsChanged(int state);
|
||||
void doSuppressDeveloperWarningsChanged(CheckState state);
|
||||
/**
|
||||
* Handler for checked state changed event of the suppress deprecated
|
||||
* warnings checkbox.
|
||||
*/
|
||||
void doSuppressDeprecatedWarningsChanged(int state);
|
||||
void doSuppressDeprecatedWarningsChanged(CheckState state);
|
||||
|
||||
/**
|
||||
* Handler for checked state changed event of the developer warnings as
|
||||
* errors checkbox.
|
||||
*/
|
||||
void doDeveloperWarningsAsErrorsChanged(int state);
|
||||
void doDeveloperWarningsAsErrorsChanged(CheckState state);
|
||||
/**
|
||||
* Handler for checked state changed event of the deprecated warnings as
|
||||
* errors checkbox.
|
||||
*/
|
||||
void doDeprecatedWarningsAsErrorsChanged(int state);
|
||||
void doDeprecatedWarningsAsErrorsChanged(CheckState state);
|
||||
|
||||
private:
|
||||
QCMake* cmakeInstance;
|
||||
|
||||
Reference in New Issue
Block a user