From 88310af6658f271edc50b1f17d778fe079d33378 Mon Sep 17 00:00:00 2001 From: Martchus Date: Sat, 18 Nov 2023 22:03:27 +0100 Subject: [PATCH] Show a warning if the current Windows version is not supported --- resources/qtconfigarguments.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/resources/qtconfigarguments.cpp b/resources/qtconfigarguments.cpp index a13f56d..55186c1 100644 --- a/resources/qtconfigarguments.cpp +++ b/resources/qtconfigarguments.cpp @@ -17,6 +17,12 @@ #include #endif +#if defined(Q_OS_WINDOWS) && (QT_VERSION >= QT_VERSION_CHECK(6, 3, 0)) +#define QT_UTILITIES_CHECK_WINDOWS_VERSION +#include +#include +#endif + #include #include @@ -180,5 +186,14 @@ void QtConfigArguments::applySettings(bool preventApplyingDefaultFont) const if (m_sceneGraphRenderLoopArg.isPresent()) { qputenv(m_sceneGraphRenderLoopArg.environmentVariable(), QByteArray(m_sceneGraphRenderLoopArg.firstValue())); } + +#ifdef QT_UTILITIES_CHECK_WINDOWS_VERSION + if (QOperatingSystemVersion::current() < QOperatingSystemVersion::Windows10_1809) { + QMessageBox::warning(nullptr, QCoreApplication::applicationName(), + QCoreApplication::translate("QtConfigArguments", + "This application requires Windows 10, version 1809 or newer. The current Windows version is older so the application might not work " + "correctly.")); + } +#endif } } // namespace CppUtilities