diff options
author | Oliver Wolff <oliver.wolff@qt.io> | 2020-11-02 07:00:18 +0100 |
---|---|---|
committer | Oliver Wolff <oliver.wolff@qt.io> | 2021-07-30 08:02:56 +0200 |
commit | 5f5c342924a0d9a2856b2f2d6db373e25723f2b0 (patch) | |
tree | 5a0c95642e83b46a91e7af735df0644287afab7b /src | |
parent | 2c6bc06267b2599d491d5c84b29a368e6a922bc1 (diff) | |
download | qtbase-5f5c342924a0d9a2856b2f2d6db373e25723f2b0.tar.gz |
Remove Windows 7, 8, and 8.1 codepaths
Pick-to: 6.2
Task-number: QTBUG-84432
Change-Id: I970d7d7e9ebdcf246a5be32d60066b4e5e948c27
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/global/qoperatingsystemversion_win.cpp | 16 | ||||
-rw-r--r-- | src/gui/rhi/qrhid3d11.cpp | 20 | ||||
-rw-r--r-- | src/plugins/platforms/windows/qwindowscontext.cpp | 27 | ||||
-rw-r--r-- | src/plugins/styles/windowsvista/qwindowsvistastyle.cpp | 15 | ||||
-rw-r--r-- | src/widgets/dialogs/qwizard_win.cpp | 4 |
5 files changed, 22 insertions, 60 deletions
diff --git a/src/corelib/global/qoperatingsystemversion_win.cpp b/src/corelib/global/qoperatingsystemversion_win.cpp index eb58b60788..c514aaf54d 100644 --- a/src/corelib/global/qoperatingsystemversion_win.cpp +++ b/src/corelib/global/qoperatingsystemversion_win.cpp @@ -90,25 +90,13 @@ OSVERSIONINFOEX qWindowsVersionInfo() result.wServicePackMinor = 0; const QByteArray winVerOverride = qgetenv("QT_WINVER_OVERRIDE"); - if (winVerOverride == "WINDOWS7" || winVerOverride == "2008_R2") { - result.dwMajorVersion = 6; - result.dwMinorVersion = 1; - } else if (winVerOverride == "WINDOWS8" || winVerOverride == "2012") { - result.dwMajorVersion = 6; - result.dwMinorVersion = 2; - } else if (winVerOverride == "WINDOWS8_1" || winVerOverride == "2012_R2") { - result.dwMajorVersion = 6; - result.dwMinorVersion = 3; - } else if (winVerOverride == "WINDOWS10" || winVerOverride == "2016") { + if (winVerOverride == "WINDOWS10" || winVerOverride == "2016") { result.dwMajorVersion = 10; } else { return realResult; } - if (winVerOverride == "2008_R2" - || winVerOverride == "2012" - || winVerOverride == "2012_R2" - || winVerOverride == "2016") { + if (winVerOverride == "2016") { // If the current host OS is a domain controller and the override OS // is also a server type OS, preserve that information if (result.wProductType == VER_NT_WORKSTATION) diff --git a/src/gui/rhi/qrhid3d11.cpp b/src/gui/rhi/qrhid3d11.cpp index 6b4be76fef..93d3e30943 100644 --- a/src/gui/rhi/qrhid3d11.cpp +++ b/src/gui/rhi/qrhid3d11.cpp @@ -170,18 +170,16 @@ inline Int aligned(Int v, Int byteAlign) static IDXGIFactory1 *createDXGIFactory2() { IDXGIFactory1 *result = nullptr; - if (QOperatingSystemVersion::current() > QOperatingSystemVersion::Windows7) { - using PtrCreateDXGIFactory2 = HRESULT (WINAPI *)(UINT, REFIID, void **); - QSystemLibrary dxgilib(QStringLiteral("dxgi")); - if (auto createDXGIFactory2 = reinterpret_cast<PtrCreateDXGIFactory2>(dxgilib.resolve("CreateDXGIFactory2"))) { - const HRESULT hr = createDXGIFactory2(0, IID_IDXGIFactory2, reinterpret_cast<void **>(&result)); - if (FAILED(hr)) { - qWarning("CreateDXGIFactory2() failed to create DXGI factory: %s", qPrintable(comErrorMessage(hr))); - result = nullptr; - } - } else { - qWarning("Unable to resolve CreateDXGIFactory2()"); + using PtrCreateDXGIFactory2 = HRESULT (WINAPI *)(UINT, REFIID, void **); + QSystemLibrary dxgilib(QStringLiteral("dxgi")); + if (auto createDXGIFactory2 = reinterpret_cast<PtrCreateDXGIFactory2>(dxgilib.resolve("CreateDXGIFactory2"))) { + const HRESULT hr = createDXGIFactory2(0, IID_IDXGIFactory2, reinterpret_cast<void **>(&result)); + if (FAILED(hr)) { + qWarning("CreateDXGIFactory2() failed to create DXGI factory: %s", qPrintable(comErrorMessage(hr))); + result = nullptr; } + } else { + qWarning("Unable to resolve CreateDXGIFactory2()"); } return result; } diff --git a/src/plugins/platforms/windows/qwindowscontext.cpp b/src/plugins/platforms/windows/qwindowscontext.cpp index 79db0b74e6..78961472b0 100644 --- a/src/plugins/platforms/windows/qwindowscontext.cpp +++ b/src/plugins/platforms/windows/qwindowscontext.cpp @@ -200,18 +200,16 @@ void QWindowsUser32DLL::init() getDisplayAutoRotationPreferences = (GetDisplayAutoRotationPreferences)library.resolve("GetDisplayAutoRotationPreferences"); setDisplayAutoRotationPreferences = (SetDisplayAutoRotationPreferences)library.resolve("SetDisplayAutoRotationPreferences"); - if (QOperatingSystemVersion::current() >= QOperatingSystemVersion::Windows8) { - enableMouseInPointer = (EnableMouseInPointer)library.resolve("EnableMouseInPointer"); - getPointerType = (GetPointerType)library.resolve("GetPointerType"); - getPointerInfo = (GetPointerInfo)library.resolve("GetPointerInfo"); - getPointerDeviceRects = (GetPointerDeviceRects)library.resolve("GetPointerDeviceRects"); - getPointerTouchInfo = (GetPointerTouchInfo)library.resolve("GetPointerTouchInfo"); - getPointerFrameTouchInfo = (GetPointerFrameTouchInfo)library.resolve("GetPointerFrameTouchInfo"); - getPointerFrameTouchInfoHistory = (GetPointerFrameTouchInfoHistory)library.resolve("GetPointerFrameTouchInfoHistory"); - getPointerPenInfo = (GetPointerPenInfo)library.resolve("GetPointerPenInfo"); - getPointerPenInfoHistory = (GetPointerPenInfoHistory)library.resolve("GetPointerPenInfoHistory"); - skipPointerFrameMessages = (SkipPointerFrameMessages)library.resolve("SkipPointerFrameMessages"); - } + enableMouseInPointer = (EnableMouseInPointer)library.resolve("EnableMouseInPointer"); + getPointerType = (GetPointerType)library.resolve("GetPointerType"); + getPointerInfo = (GetPointerInfo)library.resolve("GetPointerInfo"); + getPointerDeviceRects = (GetPointerDeviceRects)library.resolve("GetPointerDeviceRects"); + getPointerTouchInfo = (GetPointerTouchInfo)library.resolve("GetPointerTouchInfo"); + getPointerFrameTouchInfo = (GetPointerFrameTouchInfo)library.resolve("GetPointerFrameTouchInfo"); + getPointerFrameTouchInfoHistory = (GetPointerFrameTouchInfoHistory)library.resolve("GetPointerFrameTouchInfoHistory"); + getPointerPenInfo = (GetPointerPenInfo)library.resolve("GetPointerPenInfo"); + getPointerPenInfoHistory = (GetPointerPenInfoHistory)library.resolve("GetPointerPenInfoHistory"); + skipPointerFrameMessages = (SkipPointerFrameMessages)library.resolve("SkipPointerFrameMessages"); if (QOperatingSystemVersion::current() >= QOperatingSystemVersion(QOperatingSystemVersion::Windows, 10, 0, 14393)) { @@ -232,8 +230,6 @@ bool QWindowsUser32DLL::supportsPointerApi() void QWindowsShcoreDLL::init() { - if (QOperatingSystemVersion::current() < QOperatingSystemVersion::Windows8_1) - return; QSystemLibrary library(QStringLiteral("SHCore")); getProcessDpiAwareness = (GetProcessDpiAwareness)library.resolve("GetProcessDpiAwareness"); setProcessDpiAwareness = (SetProcessDpiAwareness)library.resolve("SetProcessDpiAwareness"); @@ -405,9 +401,6 @@ bool QWindowsContext::initPointer(unsigned integrationOptions) if (integrationOptions & QWindowsIntegration::DontUseWMPointer) return false; - if (QOperatingSystemVersion::current() < QOperatingSystemVersion::Windows8) - return false; - if (!QWindowsContext::user32dll.supportsPointerApi()) return false; diff --git a/src/plugins/styles/windowsvista/qwindowsvistastyle.cpp b/src/plugins/styles/windowsvista/qwindowsvistastyle.cpp index f7496b62ca..67d6b0c460 100644 --- a/src/plugins/styles/windowsvista/qwindowsvistastyle.cpp +++ b/src/plugins/styles/windowsvista/qwindowsvistastyle.cpp @@ -1773,21 +1773,6 @@ void QWindowsVistaStyle::drawComplexControl(ComplexControl control, const QStyle theme.partId = flags & State_Horizontal ? SBP_THUMBBTNHORZ : SBP_THUMBBTNVERT; theme.stateId = stateId; d->drawBackground(theme); - - if (QOperatingSystemVersion::current() < QOperatingSystemVersion::Windows8) { - const QRect gripperBounds = QWindowsXPStylePrivate::scrollBarGripperBounds(flags, widget, &theme); - // Draw gripper if there is enough space - if (!gripperBounds.isEmpty() && flags & State_Enabled) { - painter->save(); - XPThemeData grippBackground = theme; - grippBackground.partId = flags & State_Horizontal ? SBP_LOWERTRACKHORZ : SBP_LOWERTRACKVERT; - theme.rect = gripperBounds; - painter->setClipRegion(d->region(theme));// Only change inside the region of the gripper - d->drawBackground(grippBackground);// The gutter is the grippers background - d->drawBackground(theme); // Transparent gripper ontop of background - painter->restore(); - } - } } } } diff --git a/src/widgets/dialogs/qwizard_win.cpp b/src/widgets/dialogs/qwizard_win.cpp index 692583666d..24aa24de20 100644 --- a/src/widgets/dialogs/qwizard_win.cpp +++ b/src/widgets/dialogs/qwizard_win.cpp @@ -716,9 +716,7 @@ int QVistaHelper::topOffset(const QPaintDevice *device) { if (vistaState() != VistaAero) return titleBarSize() + 3; - static const int aeroOffset = - QOperatingSystemVersion::current() < QOperatingSystemVersion::Windows8 ? - QStyleHelper::dpiScaled(4, device) : QStyleHelper::dpiScaled(13, device); + static const int aeroOffset = QStyleHelper::dpiScaled(13, device); return aeroOffset + titleBarSize(); } |