mirror of
https://github.com/crystalidea/qt6windows7.git
synced 2025-01-22 20:04:29 +08:00
Compare commits
2 Commits
b371361f55
...
50a1a7f6e9
Author | SHA1 | Date | |
---|---|---|---|
|
50a1a7f6e9 | ||
|
f56de58895 |
@ -1,4 +1,4 @@
|
||||
This repository provides a backport of the Qt 6.8.1 qtbase module, tailored for compatibility with Windows 7 and 8. It contains patched source files from the qtbase module, along with some additional required files. To apply the backport, simply copy the contents of the src folder into your qtbase/src directory, replacing the existing files.
|
||||
This repository provides a backport of the Qt 6.8.1 qtbase module, tailored for compatibility with Windows 7, 8 and 8.1. It contains patched source files from the qtbase module, along with some additional required files. To apply the backport, simply copy the contents of the src folder into your qtbase/src directory, replacing the existing files.
|
||||
|
||||
This approach builds upon the methodology discussed in this forum [thread](https://forum.qt.io/topic/133002/qt-creator-6-0-1-and-qt-6-2-2-running-on-windows-7/60) but offers significant enhancements, including important fallbacks to the default Qt 6 behavior when running on newer versions of Windows.
|
||||
|
||||
|
@ -134,12 +134,42 @@ bool parseIntOption(const QString ¶meter,const QLatin1StringView &option,
|
||||
using DarkModeHandlingFlag = QNativeInterface::Private::QWindowsApplication::DarkModeHandlingFlag;
|
||||
using DarkModeHandling = QNativeInterface::Private::QWindowsApplication::DarkModeHandling;
|
||||
|
||||
typedef LONG (WINAPI *RtlGetVersionPtr)(PRTL_OSVERSIONINFOW);
|
||||
|
||||
bool isWindows81() {
|
||||
HMODULE hNtdll = GetModuleHandleA("ntdll.dll");
|
||||
if (!hNtdll) {
|
||||
return false; // Failed to load ntdll.dll
|
||||
}
|
||||
|
||||
RtlGetVersionPtr RtlGetVersion = (RtlGetVersionPtr)GetProcAddress(hNtdll, "RtlGetVersion");
|
||||
if (!RtlGetVersion) {
|
||||
return false; // Failed to get RtlGetVersion
|
||||
}
|
||||
|
||||
RTL_OSVERSIONINFOW rovi = {0};
|
||||
rovi.dwOSVersionInfoSize = sizeof(rovi);
|
||||
|
||||
if (RtlGetVersion(&rovi) == 0) { // STATUS_SUCCESS
|
||||
return (rovi.dwMajorVersion == 6 && rovi.dwMinorVersion == 3);
|
||||
}
|
||||
|
||||
return false; // Unknown version
|
||||
}
|
||||
|
||||
static inline unsigned parseOptions(const QStringList ¶mList,
|
||||
int *tabletAbsoluteRange,
|
||||
QtWindows::DpiAwareness *dpiAwareness,
|
||||
DarkModeHandling *darkModeHandling)
|
||||
{
|
||||
unsigned options = 0;
|
||||
|
||||
// for some reason DirectWrite fonts don't work on Windows 8.1
|
||||
// https://github.com/crystalidea/qt6windows7/issues/26
|
||||
|
||||
if (isWindows81())
|
||||
options |= QWindowsIntegration::DontUseDirectWriteFonts;
|
||||
|
||||
for (const QString ¶m : paramList) {
|
||||
if (param.startsWith(u"fontengine=")) {
|
||||
if (param.endsWith(u"gdi")) {
|
||||
|
Loading…
Reference in New Issue
Block a user