summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJens Bache-Wiig <jens.bache-wiig@digia.com>2012-10-16 14:44:55 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-10-16 15:29:15 +0200
commit3a685dcd5ef3b9e264abd7aacc9a8daffdb67992 (patch)
tree813d69386737a8a9e2835b31088ff920ffec190f /src
parent67ff4607780bf8985aab198178190fcc6fb133f6 (diff)
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 <gabriel.dedietrich@digia.com> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/widgets/styles/qstylehelper.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/widgets/styles/qstylehelper.cpp b/src/widgets/styles/qstylehelper.cpp
index b8fbf37333..e23db2b637 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
}