Update QHighDpiScaling on DPI change
Make sure Qt reacts correctly to DPI changes while the application is running, also when going from “standard-dpi” to “high-dpi” (like Windows 100% to 200%). Call QHighDpiScaling::upateHighDpiScaling() on DPI change and update the m_usePixelDensity flag from there. Fixes: QTBUG-85384 Pick-to: 5.15 Change-Id: I8ca83e4eea76cc8ba701a18e1f8c535b9953918f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
This commit is contained in:
parent
ade59ea316
commit
733b653844
@ -3092,6 +3092,8 @@ void QGuiApplicationPrivate::processScreenLogicalDotsPerInchChange(QWindowSystem
|
||||
if (QCoreApplication::startingUp())
|
||||
return;
|
||||
|
||||
QHighDpiScaling::updateHighDpiScaling();
|
||||
|
||||
if (!e->screen)
|
||||
return;
|
||||
|
||||
|
@ -495,6 +495,8 @@ void QHighDpiScaling::updateHighDpiScaling()
|
||||
if (QCoreApplication::testAttribute(Qt::AA_DisableHighDpiScaling))
|
||||
return;
|
||||
|
||||
m_usePixelDensity = usePixelDensity();
|
||||
|
||||
if (m_usePixelDensity && !m_pixelDensityScalingActive) {
|
||||
const auto screens = QGuiApplication::screens();
|
||||
for (QScreen *screen : screens) {
|
||||
|
Loading…
Reference in New Issue
Block a user