From 63ffbc4a6f415d062c71e3a089663700dbe237d2 Mon Sep 17 00:00:00 2001 From: Martchus Date: Fri, 15 Mar 2024 23:54:17 +0100 Subject: [PATCH] Avoid warning after `QOperatingSystemVersion::OSType` was moved This is now `QOperatingSystemVersionBase::OSType` causing a warning about an implicit conversion. Making an explicit cast to whatever type `os.type()` actually returns (depends on the Qt version) this warning does not occur anymore and the code should still compile with any Qt version. --- settingsdialog/qtsettings.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settingsdialog/qtsettings.cpp b/settingsdialog/qtsettings.cpp index 2066bd3..afb5209 100644 --- a/settingsdialog/qtsettings.cpp +++ b/settingsdialog/qtsettings.cpp @@ -352,7 +352,7 @@ void QtSettings::apply() } const auto debugLoggingEnabled = CppUtilities::isEnvVariableSet(PROJECT_VARNAME_UPPER "_LOG_QT_CONFIG"); if (debugLoggingEnabled.has_value() && debugLoggingEnabled.value()) { - if (const auto os = QOperatingSystemVersion::current(); os.type() != QOperatingSystemVersion::Unknown) { + if (const auto os = QOperatingSystemVersion::current(); os.type() != static_cast(QOperatingSystemVersion::Unknown)) { const auto version = QVersionNumber(os.majorVersion(), os.minorVersion(), os.microVersion()); std::cerr << "OS name and version: " << os.name().toStdString() << ' ' << version.toString().toStdString() << '\n'; }