summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/windows/qwindowstheme.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2015-05-05 15:06:56 +0200
committerFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2015-06-02 11:00:55 +0000
commitdbe2dd295cce19680f8ba7a7cca65150701051e2 (patch)
treeeeca7ecc497847ba6fd47751b8f36db64bdc6091 /src/plugins/platforms/windows/qwindowstheme.cpp
parent7e4fba3e56404c0bc9692269671eb49b08c313a6 (diff)
Adapt Windows plugin to new HighDPI API.
- Implement QPlatformScreen::pixelDensity(). - Map coordinates. Change-Id: Ieaf4e3b0f3969607216d7713c5d6f1e60fa27116 Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
Diffstat (limited to 'src/plugins/platforms/windows/qwindowstheme.cpp')
-rw-r--r--src/plugins/platforms/windows/qwindowstheme.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/plugins/platforms/windows/qwindowstheme.cpp b/src/plugins/platforms/windows/qwindowstheme.cpp
index 03e7b9e171..873052973e 100644
--- a/src/plugins/platforms/windows/qwindowstheme.cpp
+++ b/src/plugins/platforms/windows/qwindowstheme.cpp
@@ -67,6 +67,7 @@
#include <QtGui/QPainter>
#include <QtGui/QPixmapCache>
#include <qpa/qwindowsysteminterface.h>
+#include <private/qhighdpiscaling_p.h>
#include <private/qsystemlibrary_p.h>
#include <algorithm>
@@ -494,7 +495,8 @@ static QPixmap loadIconFromShell32(int resourceId, QSizeF size)
QPixmap QWindowsTheme::standardPixmap(StandardPixmap sp, const QSizeF &size) const
{
- const int scaleFactor = 1; // HIGDPI Fixme: ?
+ const QScreen *primaryScreen = QGuiApplication::primaryScreen();
+ const int scaleFactor = primaryScreen ? qRound(QHighDpiScaling::factor(primaryScreen)) : 1;
const QSizeF pixmapSize = size * scaleFactor;
int resourceId = -1;
LPCTSTR iconName = 0;