summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qplatformscreen.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/kernel/qplatformscreen.cpp')
-rw-r--r--src/gui/kernel/qplatformscreen.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gui/kernel/qplatformscreen.cpp b/src/gui/kernel/qplatformscreen.cpp
index 7c1e2158b1..952bcd7073 100644
--- a/src/gui/kernel/qplatformscreen.cpp
+++ b/src/gui/kernel/qplatformscreen.cpp
@@ -189,6 +189,8 @@ QDpi QPlatformScreen::logicalDpi() const
QSizeF ps = physicalSize();
QSize s = geometry().size();
+ if (qFuzzyIsNull(ps.width()) || qFuzzyIsNull(ps.height()))
+ return QDpi(96, 96);
return QDpi(25.4 * s.width() / ps.width(),
25.4 * s.height() / ps.height());
}