From be8b6047ccd43df1127beb4c602c58408ff9b612 Mon Sep 17 00:00:00 2001 From: "Bradley T. Hughes" Date: Tue, 31 Mar 2009 13:19:23 +0200 Subject: Add QSysInfo::WV_WINDOWS7 --- src/corelib/global/qglobal.cpp | 9 ++++++++- src/corelib/global/qglobal.h | 2 ++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index 459167e..bcb17a2 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -1054,6 +1054,7 @@ bool qSharedBuild() \value WV_XP Windows XP (operating system version 5.1) \value WV_2003 Windows Server 2003, Windows Server 2003 R2, Windows Home Server, Windows XP Professional x64 Edition (operating system version 5.2) \value WV_VISTA Windows Vista, Windows Server 2008 (operating system version 6.0) + \value WV_WINDOWS7 Windows 7 (operating system version 6.1) Alternatively, you may use the following macros which correspond directly to the Windows operating system version number: @@ -1062,6 +1063,7 @@ bool qSharedBuild() \value WV_5_1 Operating system version 5.1, corresponds to Windows XP \value WV_5_2 Operating system version 5.2, corresponds to Windows Server 2003, Windows Server 2003 R2, Windows Home Server, and Windows XP Professional x64 Edition \value WV_6_0 Operating system version 6.0, corresponds to Windows Vista and Windows Server 2008 + \value WV_6_1 Operation system version 6.1, corresponds to Windows 7 CE-based versions: @@ -1632,7 +1634,10 @@ QSysInfo::WinVersion QSysInfo::windowsVersion() if (osver.dwMajorVersion < 5) { winver = QSysInfo::WV_NT; } else if (osver.dwMajorVersion == 6) { - winver = QSysInfo::WV_VISTA; + if (osver.dwMinorVersion == 0) + winver = QSysInfo::WV_VISTA; + else + winver = QSysInfo::WV_WINDOWS7; } else if (osver.dwMinorVersion == 0) { winver = QSysInfo::WV_2000; } else if (osver.dwMinorVersion == 1) { @@ -1667,6 +1672,8 @@ QSysInfo::WinVersion QSysInfo::windowsVersion() winver = QSysInfo::WV_XP; else if (override == "VISTA") winver = QSysInfo::WV_VISTA; + else if (override == "WINDOWS7") + winver = QSysInfo::WV_WINDOWS7; } #endif diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 9522e39..872dcf5 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -1309,6 +1309,7 @@ public: WV_XP = 0x0030, WV_2003 = 0x0040, WV_VISTA = 0x0080, + WV_WINDOWS7 = 0x0090, WV_NT_based = 0x00f0, /* version numbers */ @@ -1317,6 +1318,7 @@ public: WV_5_1 = WV_XP, WV_5_2 = WV_2003, WV_6_0 = WV_VISTA, + WV_6_1 = WV_WINDOWS7, WV_CE = 0x0100, WV_CENET = 0x0200, -- cgit v0.12