From dd52fd0024600d3beffc82d6da02b4239a62d725 Mon Sep 17 00:00:00 2001 From: Jocelyn Turcotte Date: Tue, 17 Jan 2017 17:05:00 +0100 Subject: Ensure a pixel density of at least 1 for Qt::AA_EnableHighDpiScaling Very large 1080p TVs or any display which is running at an abnormally low resolution can have a DPI lower than 48, which means that qRound(dpi/96) will result in a 0 pixel density, causing critical issues for applications using Qt::AA_EnableHighDpiScaling. Make sure that we always have a pixel density of at least 1 to allow applications not having to worry about such displays. Task-number: QTBUG-56140 Change-Id: I1dafbf7794a99ae6f872984c0337d8ff0d1fc1c0 Reviewed-by: Shawn Rutledge Reviewed-by: Friedemann Kleint --- src/plugins/platforms/eglfs/api/qeglfsdeviceintegration.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/plugins/platforms/eglfs') diff --git a/src/plugins/platforms/eglfs/api/qeglfsdeviceintegration.cpp b/src/plugins/platforms/eglfs/api/qeglfsdeviceintegration.cpp index 3e1e93f1e4..863a115b74 100644 --- a/src/plugins/platforms/eglfs/api/qeglfsdeviceintegration.cpp +++ b/src/plugins/platforms/eglfs/api/qeglfsdeviceintegration.cpp @@ -226,7 +226,7 @@ QDpi QEglFSDeviceIntegration::logicalDpi() const qreal QEglFSDeviceIntegration::pixelDensity() const { - return qRound(logicalDpi().first / qreal(100)); + return qMax(1, qRound(logicalDpi().first / qreal(100))); } Qt::ScreenOrientation QEglFSDeviceIntegration::nativeOrientation() const -- cgit v1.2.3