Explorar o código

cmake-gui: Port away from deprecated API in Qt >= 6.7

Brad King hai 11 meses
pai
achega
cbf0d3da52
Modificáronse 1 ficheiros con 9 adicións e 7 borrados
  1. 9 7
      Source/QtDialog/WarningMessagesDialog.cxx

+ 9 - 7
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);
 }