diff options
author | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2015-06-29 10:25:24 +0200 |
---|---|---|
committer | Paul Olav Tvete <paul.tvete@theqtcompany.com> | 2015-07-30 12:44:58 +0000 |
commit | fd6821740fece8650cac7494a2cffe63e2bebb9c (patch) | |
tree | 15f5dddd919ad3cad52a6cf1cd554fd54e0e0635 /src/plugins/platforms/windows/qwindowsscreen.cpp | |
parent | a705b4ec1f6f7133390054f8b6b8077ef0550311 (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/qwindowsscreen.cpp')
-rw-r--r-- | src/plugins/platforms/windows/qwindowsscreen.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/plugins/platforms/windows/qwindowsscreen.cpp b/src/plugins/platforms/windows/qwindowsscreen.cpp index 5863629a01..391735a035 100644 --- a/src/plugins/platforms/windows/qwindowsscreen.cpp +++ b/src/plugins/platforms/windows/qwindowsscreen.cpp @@ -43,6 +43,7 @@ #include <QtGui/QPixmap> #include <QtGui/QGuiApplication> #include <qpa/qwindowsysteminterface.h> +#include <private/qhighdpiscaling_p.h> #include <QtGui/QScreen> #include <QtCore/QDebug> @@ -287,6 +288,12 @@ QWindowsScreen *QWindowsScreen::screenOf(const QWindow *w) return 0; } +qreal QWindowsScreen::pixelDensity() const +{ + const qreal physicalDpi = m_data.geometry.width() / m_data.physicalSizeMM.width() * qreal(25.4); + return qRound(physicalDpi / 96); +} + /*! \brief Determine siblings in a virtual desktop system. |