diff options
Diffstat (limited to 'src/plugins/platforms/windows')
-rw-r--r-- | src/plugins/platforms/windows/qwindowscontext.cpp | 16 | ||||
-rw-r--r-- | src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp | 2 | ||||
-rw-r--r-- | src/plugins/platforms/windows/qwindowsfontengine.cpp | 2 |
3 files changed, 7 insertions, 13 deletions
diff --git a/src/plugins/platforms/windows/qwindowscontext.cpp b/src/plugins/platforms/windows/qwindowscontext.cpp index 545484de8d..3f4555a31f 100644 --- a/src/plugins/platforms/windows/qwindowscontext.cpp +++ b/src/plugins/platforms/windows/qwindowscontext.cpp @@ -271,22 +271,19 @@ QWindowsContextPrivate::QWindowsContextPrivate() : m_eventType(QByteArrayLiteral("windows_generic_MSG")), m_lastActiveWindow(0), m_asyncExpose(0) { + const QSysInfo::WinVersion ver = QSysInfo::windowsVersion(); #ifndef Q_OS_WINCE QWindowsContext::user32dll.init(); QWindowsContext::shell32dll.init(); -#endif // Ensure metrics functions report correct data, QTBUG-30063. if (QWindowsContext::user32dll.setProcessDPIAware) QWindowsContext::user32dll.setProcessDPIAware(); - m_displayContext = GetDC(0); - m_defaultDPI = GetDeviceCaps(m_displayContext, LOGPIXELSY); - const QSysInfo::WinVersion ver = QSysInfo::windowsVersion(); -#ifndef Q_OS_WINCE if (hasTouchSupport(ver) && QWindowsContext::user32dll.initTouch()) m_systemInfo |= QWindowsContext::SI_SupportsTouch; -#endif - +#endif // !Q_OS_WINCE + m_displayContext = GetDC(0); + m_defaultDPI = GetDeviceCaps(m_displayContext, LOGPIXELSY); if (useRTL_Extensions(ver)) { m_systemInfo |= QWindowsContext::SI_RTL_Extensions; m_keyMapper.setUseRTLExtensions(true); @@ -417,10 +414,7 @@ QString QWindowsContext::registerWindowClass(const QWindow *w, bool isGL) if (icon) cname += QStringLiteral("Icon"); - HBRUSH brush = 0; - if (!isGL) - brush = GetSysColorBrush(COLOR_WINDOW); - return registerWindowClass(cname, qWindowsWndProc, style, brush, icon); + return registerWindowClass(cname, qWindowsWndProc, style, GetSysColorBrush(COLOR_WINDOW), icon); } QString QWindowsContext::registerWindowClass(QString cname, diff --git a/src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp b/src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp index 98b4e7af62..7f97d58be4 100644 --- a/src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp +++ b/src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp @@ -285,7 +285,7 @@ static bool addFontToDatabase(const QString &familyName, uchar charSet, return false; if (!QDir::isAbsolutePath(value)) - value.prepend(QString::fromLocal8Bit(qgetenv("windir") + "\\Fonts\\")); + value.prepend(QFile::decodeName(qgetenv("windir") + "\\Fonts\\")); QPlatformFontDatabase::registerFont(faceName, QString(), foundryName, weight, style, stretch, antialias, scalable, size, fixed, writingSystems, createFontFile(value, index)); diff --git a/src/plugins/platforms/windows/qwindowsfontengine.cpp b/src/plugins/platforms/windows/qwindowsfontengine.cpp index c402f00453..5757bcad4e 100644 --- a/src/plugins/platforms/windows/qwindowsfontengine.cpp +++ b/src/plugins/platforms/windows/qwindowsfontengine.cpp @@ -190,7 +190,7 @@ void QWindowsFontEngine::getCMap() unitsPerEm = otm->otmEMSquare; x_height = (int)otm->otmsXHeight; loadKerningPairs(designToDevice); - _faceId.filename = QString::fromWCharArray((wchar_t *)((char *)otm + (quintptr)otm->otmpFullName)).toLatin1(); + _faceId.filename = QFile::encodeName(QString::fromWCharArray((wchar_t *)((char *)otm + (quintptr)otm->otmpFullName))); lineWidth = otm->otmsUnderscoreSize; fsType = otm->otmfsType; free(otm); |