Fix incorrectly scaled constants on Mac
authorJens Bache-Wiig <jens.bache-wiig@digia.com>
Tue, 16 Oct 2012 12:44:55 +0000 (14:44 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Tue, 16 Oct 2012 13:29:15 +0000 (15:29 +0200)
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 <gabriel.dedietrich@digia.com>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
src/widgets/styles/qstylehelper.cpp

index b8fbf37..e23db2b 100644 (file)
@@ -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
 }