summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qapplication_win.cpp
diff options
context:
space:
mode:
authorJens Bache-Wiig <jens.bache-wiig@nokia.com>2009-06-25 14:35:55 (GMT)
committerJens Bache-Wiig <jens.bache-wiig@nokia.com>2009-06-25 14:37:04 (GMT)
commitdb24e82b6b74be303492f186a45d784fcd84fdc6 (patch)
tree13b3358df74d262a97356c5759a77debec4051bc /src/gui/kernel/qapplication_win.cpp
parent47c9e7b1b3551ff6dbe71590461a45ae398a9501 (diff)
downloadQt-db24e82b6b74be303492f186a45d784fcd84fdc6.zip
Qt-db24e82b6b74be303492f186a45d784fcd84fdc6.tar.gz
Qt-db24e82b6b74be303492f186a45d784fcd84fdc6.tar.bz2
Improved support for DPI on Mac and Vista/7
This significantly improves the support for higher DPI-values on these platforms by ensuring that common pixelmetrics are scaled accordingly. In addition we mark all Qt apps as DPI-aware on Windows 7 by calling SetProcessDPIAware. We also changed the way we draw pixmaps on the mac paintengine when using dpi scaling > 1 to ensure smooth pixmap scaling. Reviewed-by: nrc Task-id: 242417
Diffstat (limited to 'src/gui/kernel/qapplication_win.cpp')
-rw-r--r--src/gui/kernel/qapplication_win.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/gui/kernel/qapplication_win.cpp b/src/gui/kernel/qapplication_win.cpp
index 324fac7..a690ffd 100644
--- a/src/gui/kernel/qapplication_win.cpp
+++ b/src/gui/kernel/qapplication_win.cpp
@@ -720,7 +720,11 @@ void QApplicationPrivate::initializeWidgetPaletteHash()
typedef BOOL (WINAPI *PtrUpdateLayeredWindow)(HWND hwnd, HDC hdcDst, const POINT *pptDst,
const SIZE *psize, HDC hdcSrc, const POINT *pptSrc, COLORREF crKey,
const Q_BLENDFUNCTION *pblend, DWORD dwflags);
+
+typedef BOOL (WINAPI *PtrSetProcessDPIAware) (VOID);
+
static PtrUpdateLayeredWindow ptrUpdateLayeredWindow = 0;
+static PtrSetProcessDPIAware ptrSetProcessDPIAware = 0;
static BOOL WINAPI qt_updateLayeredWindowIndirect(HWND hwnd, const Q_UPDATELAYEREDWINDOWINFO *info)
{
@@ -846,6 +850,11 @@ void qt_init(QApplicationPrivate *priv, int)
if (ptrUpdateLayeredWindow && !ptrUpdateLayeredWindowIndirect)
ptrUpdateLayeredWindowIndirect = qt_updateLayeredWindowIndirect;
+
+ // Notify Vista and Windows 7 that we support highter DPI settings
+ if (ptrSetProcessDPIAware = (PtrSetProcessDPIAware)
+ QLibrary::resolve(QLatin1String("user32"), "SetProcessDPIAware"))
+ ptrSetProcessDPIAware();
#endif
}