diff options
Diffstat (limited to 'src/gui/kernel/qplatformscreen.cpp')
-rw-r--r-- | src/gui/kernel/qplatformscreen.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gui/kernel/qplatformscreen.cpp b/src/gui/kernel/qplatformscreen.cpp index fc405dee006..f3213bf5ea4 100644 --- a/src/gui/kernel/qplatformscreen.cpp +++ b/src/gui/kernel/qplatformscreen.cpp @@ -193,6 +193,14 @@ QDpi QPlatformScreen::logicalDpi() const 25.4 * s.height() / ps.height()); } +// Helper function for accessing the platform screen logical dpi +// which accounts for QT_FONT_DPI. +QPair<qreal, qreal> QPlatformScreen::overrideDpi(const QPair<qreal, qreal> &in) +{ + static const int overrideDpi = qEnvironmentVariableIntValue("QT_FONT_DPI"); + return overrideDpi > 0 ? QDpi(overrideDpi, overrideDpi) : in; +} + /*! Reimplement to return the base logical DPI for the platform. This DPI value should correspond to a standard-DPI (1x) display. The |