From 3a685dcd5ef3b9e264abd7aacc9a8daffdb67992 Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig Date: Tue, 16 Oct 2012 14:44:55 +0200 Subject: [PATCH] Fix incorrectly scaled constants on Mac This fixes several scaled constants on mac that are inherited from commonstyle. (such as toolbutton arrows) It is probably easiest to see when running Windows style on mac. The problem was that the code assumed a default dpi of 96 would be used on all platforms. Change-Id: I83789589009b268dcb1d96629c3ec9e8f968a891 Reviewed-by: Gabriel de Dietrich Reviewed-by: Richard Moe Gustavsen Reviewed-by: Shawn Rutledge --- src/widgets/styles/qstylehelper.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/widgets/styles/qstylehelper.cpp b/src/widgets/styles/qstylehelper.cpp index b8fbf37..e23db2b 100644 --- a/src/widgets/styles/qstylehelper.cpp +++ b/src/widgets/styles/qstylehelper.cpp @@ -77,8 +77,13 @@ QString uniqueName(const QString &key, const QStyleOption *option, const QSize & qreal dpiScaled(qreal value) { +#ifdef Q_OS_MAC + // On mac the DPI is allways 72 so we should not scale it + return value; +#else static const qreal scale = qreal(qt_defaultDpiX()) / 96.0; return value * scale; +#endif } -- 2.7.4