summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/windows/qwindowstheme.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2015-06-29 10:25:24 +0200
committerPaul Olav Tvete <paul.tvete@theqtcompany.com>2015-07-30 12:44:58 +0000
commitfd6821740fece8650cac7494a2cffe63e2bebb9c (patch)
tree15f5dddd919ad3cad52a6cf1cd554fd54e0e0635 /src/plugins/platforms/windows/qwindowstheme.cpp
parenta705b4ec1f6f7133390054f8b6b8077ef0550311 (diff)
Highdpi changes for Windows
Adapt the Windows plugin to work with the new cross-platform high-DPI scaling. Task-number: QTBUG-38993 Task-number: QTBUG-46615 Change-Id: I108d319255925a290b75611e95ef006d4aaf7ace Reviewed-by: Lars Knoll <lars.knoll@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 a000f107a9..a541fd4629 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;