On some platforms (Windows and macOS) it has been observed that the platform layer removes all screens, without providing a dummy screen. This results in QGuiApplication::screens() being empty. As updating the cached DPR for a window is part of the window moving to a new screen, we have to guard for the case where the window moves to a nullptr screen (because QGuiApplication::primaryScreen() is now null). We use the QGuiApplication::devicePixelRatio() fallback path, which returns 1.0 if there are no screens. Fixes: QTBUG-128390 Pick-to: 6.7 Change-Id: I3ba20590047f1ef49c8d3ac5b7556b814a105ce4 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit fbf957de5feded9cbbd60feacaa08c9902815c38) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
…
Description
Languages
C++
84.3%
HTML
4.9%
C
3.9%
CMake
3.6%
Objective-C++
2%
Other
0.8%