mirror of
https://github.com/crystalidea/qt6windows7.git
synced 2025-01-22 20:04:29 +08:00
fixed #26
This commit is contained in:
parent
b371361f55
commit
f56de58895
@ -134,12 +134,42 @@ bool parseIntOption(const QString ¶meter,const QLatin1StringView &option,
|
|||||||
using DarkModeHandlingFlag = QNativeInterface::Private::QWindowsApplication::DarkModeHandlingFlag;
|
using DarkModeHandlingFlag = QNativeInterface::Private::QWindowsApplication::DarkModeHandlingFlag;
|
||||||
using DarkModeHandling = QNativeInterface::Private::QWindowsApplication::DarkModeHandling;
|
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,
|
static inline unsigned parseOptions(const QStringList ¶mList,
|
||||||
int *tabletAbsoluteRange,
|
int *tabletAbsoluteRange,
|
||||||
QtWindows::DpiAwareness *dpiAwareness,
|
QtWindows::DpiAwareness *dpiAwareness,
|
||||||
DarkModeHandling *darkModeHandling)
|
DarkModeHandling *darkModeHandling)
|
||||||
{
|
{
|
||||||
unsigned options = 0;
|
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) {
|
for (const QString ¶m : paramList) {
|
||||||
if (param.startsWith(u"fontengine=")) {
|
if (param.startsWith(u"fontengine=")) {
|
||||||
if (param.endsWith(u"gdi")) {
|
if (param.endsWith(u"gdi")) {
|
||||||
|
Loading…
Reference in New Issue
Block a user