From c47b04696a9d1dab04c4a59ed9ce4c28aa00fe98 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 28 Jul 2014 14:34:50 +0200 Subject: Add devicePixelRatio support to the Windows QPA plugin. This adds support for the environment variable QT_DEVICE_PIXEL_RATIO for the Windows platform plugin. Task-number: QTBUG-38993 Task-number: QTBUG-38858 Change-Id: I6831eb6d3a09a80be7bbef46395e91531b61cc50 Reviewed-by: Alessandro Portale Reviewed-by: Paul Olav Tvete --- src/plugins/platforms/windows/qwindowsinputcontext.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/plugins/platforms/windows/qwindowsinputcontext.cpp') diff --git a/src/plugins/platforms/windows/qwindowsinputcontext.cpp b/src/plugins/platforms/windows/qwindowsinputcontext.cpp index f8676c30f7..2284c47ed6 100644 --- a/src/plugins/platforms/windows/qwindowsinputcontext.cpp +++ b/src/plugins/platforms/windows/qwindowsinputcontext.cpp @@ -44,6 +44,7 @@ #include "qwindowswindow.h" #include "qwindowsintegration.h" #include "qwindowsmousehandler.h" +#include "qwindowsscaling.h" #include #include @@ -214,9 +215,10 @@ void QWindowsInputContext::cursorRectChanged() if (!m_compositionContext.hwnd) return; const QInputMethod *inputMethod = QGuiApplication::inputMethod(); - QRect cursorRectangle = inputMethod->cursorRectangle().toRect(); - if (!cursorRectangle.isValid()) + const QRect cursorRectangleDip = inputMethod->cursorRectangle().toRect(); + if (!cursorRectangleDip.isValid()) return; + const QRect cursorRectangle = QWindowsScaling::mapToNative(cursorRectangleDip); qCDebug(lcQpaInputMethods) << __FUNCTION__<< cursorRectangle; -- cgit v1.2.3