summaryrefslogtreecommitdiffstats
path: root/src/corelib/global/qoperatingsystemversion.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/global/qoperatingsystemversion.cpp')
-rw-r--r--src/corelib/global/qoperatingsystemversion.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/corelib/global/qoperatingsystemversion.cpp b/src/corelib/global/qoperatingsystemversion.cpp
index bc6adb54dc..a0ea801ba1 100644
--- a/src/corelib/global/qoperatingsystemversion.cpp
+++ b/src/corelib/global/qoperatingsystemversion.cpp
@@ -42,6 +42,10 @@
#include "qoperatingsystemversion_p.h"
#endif
+#if defined(Q_OS_DARWIN)
+#include <QtCore/private/qcore_mac_p.h>
+#endif
+
#include <qversionnumber.h>
#include <qdebug.h>
@@ -446,6 +450,27 @@ const QOperatingSystemVersion QOperatingSystemVersion::MacOSCatalina =
QOperatingSystemVersion(QOperatingSystemVersion::MacOS, 10, 15);
/*!
+ \variable QOperatingSystemVersion::MacOSBigSur
+ \brief a version corresponding to macOS Big Sur
+
+ The actual version number depends on whether the application was built
+ using the Xcode 12 SDK. If it was, the version number corresponds
+ to macOS 11.0. If not it will correspond to macOS 10.16.
+
+ By comparing QOperatingSystemVersion::current() to this constant
+ you will always end up comparing to the right version number.
+ \since 6.0
+ */
+const QOperatingSystemVersion QOperatingSystemVersion::MacOSBigSur = [] {
+#if defined(Q_OS_DARWIN)
+ if (QMacVersion::buildSDK(QMacVersion::ApplicationBinary) >= QOperatingSystemVersion(QOperatingSystemVersion::MacOS, 10, 16))
+ return QOperatingSystemVersion(QOperatingSystemVersion::MacOS, 11, 0);
+ else
+#endif
+ return QOperatingSystemVersion(QOperatingSystemVersion::MacOS, 10, 16);
+}();
+
+/*!
\variable QOperatingSystemVersion::AndroidJellyBean
\brief a version corresponding to Android Jelly Bean (version 4.1, API level 16).
\since 5.9