summaryrefslogtreecommitdiffstats
path: root/src/widgets/styles
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/styles')
-rw-r--r--src/widgets/styles/qstylehelper.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/widgets/styles/qstylehelper.cpp b/src/widgets/styles/qstylehelper.cpp
index 9477ca86da..6016224faa 100644
--- a/src/widgets/styles/qstylehelper.cpp
+++ b/src/widgets/styles/qstylehelper.cpp
@@ -101,7 +101,13 @@ Q_WIDGETS_EXPORT qreal dpi(const QStyleOption *option)
if (option)
return option->fontMetrics.fontDpi();
+ // Fall back to historical Qt behavior: hardocded 72 DPI on mac,
+ // primary screen DPI on other platforms.
+#ifdef Q_OS_DARWIN
return qstyleBaseDpi;
+#else
+ return qt_defaultDpiX();
+#endif
}
Q_WIDGETS_EXPORT qreal dpiScaled(qreal value, qreal dpi)