From 29c6e39086831f6811e94364273c1f4bff119bef Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 18 Jul 2016 10:53:41 +0200 Subject: Windows style: Scale native metrics per monitor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The native sizes returned by the metrics and theme functions refer to the primary monitor. They need adaption when showing on a secondary monitor with differing logical DPI. Introduce a helper function QWindowsStylePrivate::nativeMetricScaleFactor() to calculate the total factor. Task-number: QTBUG-49374 Change-Id: I34c843ff34108424e1ef0aafcf9f563d17ebbc89 Reviewed-by: Morten Johan Sørvig --- src/widgets/styles/qwindowsstyle_p_p.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/widgets/styles/qwindowsstyle_p_p.h') diff --git a/src/widgets/styles/qwindowsstyle_p_p.h b/src/widgets/styles/qwindowsstyle_p_p.h index 7971b84923..dc5a15db70 100644 --- a/src/widgets/styles/qwindowsstyle_p_p.h +++ b/src/widgets/styles/qwindowsstyle_p_p.h @@ -66,6 +66,7 @@ public: static int fixedPixelMetric(QStyle::PixelMetric pm); static qreal devicePixelRatio(const QWidget *widget = 0) { return widget ? widget->devicePixelRatioF() : QWindowsStylePrivate::appDevicePixelRatio(); } + static qreal nativeMetricScaleFactor(const QWidget *widget = Q_NULLPTR); bool hasSeenAlt(const QWidget *widget) const; bool altDown() const { return alt_down; } @@ -98,3 +99,4 @@ QT_END_NAMESPACE #endif // QT_NO_STYLE_WINDOWS #endif //QWINDOWSSTYLE_P_P_H +; -- cgit v1.2.3